有效登录ASP.NET上的重定向URI错误

时间:2012-07-17 22:05:10

标签: c# asp.net iis login

我试图使用一个在ASP.NET中编码并运行IIS和SQL Server 2008的软件。

我已经安装了所有这些,包括数据库等。

当我来使用脚本(安装在运行IIS的本地计算机上)并登录软件时出现错误。 当我使用有效的登录时,它会给我一个错误

Redirect URI cannot contain newline characters.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: Redirect URI cannot contain newline characters.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace: 


[ArgumentException: Redirect URI cannot contain newline characters.]
   System.Web.HttpResponse.Redirect(String url, Boolean endResponse, Boolean permanent) +11327996
   PirTickets.Account.Login.LoginButton_Click(Object sender, EventArgs e) +1158
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3691

但是,当我输入无效的登录信息时,它会给我一条消息,说明它无效。 我知道与数据库的连接是正常的,因为它在从数据库获取的其他地方输出文本。

继承人Login.ASPX代码:

 <%@ Page Title="Log In" Language="C#" MasterPageFile="~/Master/MasterPage.master" AutoEventWireup="true"
    CodeBehind="Login.aspx.cs" Inherits="PirTickets.Account.Login" EnableViewStateMac="false" ViewStateEncryptionMode="Never"  %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="Head">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <h2>
        Log In
    </h2>
    <p>

        Customers and Trade users log in
        <a href="../Custlogin.aspx">here</a>

    </p>


            <span class="failureNotification">
                <asp:Literal ID="FailureText" runat="server"></asp:Literal>
            </span>
            <div class="accountInfo">
                <fieldset class="login">
                    <legend>Account Information</legend>
                    <p>
                        <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Username:</asp:Label>
                        <asp:TextBox ID="UserName" runat="server" CssClass="textEntry" EnableViewState="False"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" 
                             CssClass="failureNotification" ErrorMessage="User Name is required." ToolTip="User Name is required." 
                            >*</asp:RequiredFieldValidator>
                    </p>
                    <p>
                        <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
                        <asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password" EnableViewState="False"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" 
                             CssClass="failureNotification" ErrorMessage="Password is required." ToolTip="Password is required." 
                            >*</asp:RequiredFieldValidator>
                    </p>
                    <p>

                        <asp:CheckBox ID="chkRememberMe" runat="server" Text="Remember Me" 
                            TextAlign="Left" />

                    </p>
                </fieldset>
                <p class="submitButton">
                    <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In" 
                         onclick="LoginButton_Click"/>
                </p>
            </div>


</asp:Content>

任何人都可以围绕这个吗? 如果需要任何其他信息,请询问,我将编辑此问题,

干杯

0 个答案:

没有答案