Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 有效登录ASP.NET时重定向URI错误_C#_Asp.net_Iis_Login - Fatal编程技术网

C# 有效登录ASP.NET时重定向URI错误

C# 有效登录ASP.NET时重定向URI错误,c#,asp.net,iis,login,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 cu

我正在尝试使用一个用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>

帐户信息 用户名: *

密码: *

有人能把他们的头绕在这上面吗? 如果需要任何其他信息,请提问,我将编辑此问题


干杯

onclick=“LoginButton\u单击”-此方法在哪里?它应该在Login.aspx.cs上,应该是另一个文件吗?很抱歉,此ASP.NET的新版本如果web应用程序中没有.aspx.cs文件,则它可能已编译。这意味着您必须使用类似ILSpy的东西从应用程序的.dll读取代码,以了解它需要什么。说明中只说明我只需要设置它并准备就绪-如果您可以自己查看的话,这些文件在这里?我找到了它,它看起来像是用cookies来设置东西,并将其存储在清晰的FYI中,您是否启用了cookies?