title: Redirect URI Error On Valid Login ASP.NET
body: <p>Im trying to use a piece of software which is coded in ASP.NET and runs off of IIS and SQL Server 2008.</p>
  
  <p>I have it all installed including the database etc.</p>
  
  <p>When i come to use the script (installed on local machine running IIS) and login to the software im getting an error.
  When i use a valid login it gives me an error of </p>
  
  <pre><code>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
  </code></pre>
  
  <p>However, when i type in an invalid login it gives me a message that its invalid.
  I know the connection to the database is ok as it is outputting text in other places which it gets from the database.</p>
  
  <p>Heres the Login.ASPX code:</p>
  
  <pre><code> &lt;%@ Page Title="Log In" Language="C#" MasterPageFile="~/Master/MasterPage.master" AutoEventWireup="true"
      CodeBehind="Login.aspx.cs" Inherits="PirTickets.Account.Login" EnableViewStateMac="false" ViewStateEncryptionMode="Never"  %&gt;
  
  &lt;asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="Head"&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="ContentPlaceHolder1"&gt;
      &lt;h2&gt;
          Log In
      &lt;/h2&gt;
      &lt;p&gt;
  
          Customers and Trade users log in
          &lt;a href="../Custlogin.aspx"&gt;here&lt;/a&gt;
  
      &lt;/p&gt;
  
  
              &lt;span class="failureNotification"&gt;
                  &lt;asp:Literal ID="FailureText" runat="server"&gt;&lt;/asp:Literal&gt;
              &lt;/span&gt;
              &lt;div class="accountInfo"&gt;
                  &lt;fieldset class="login"&gt;
                      &lt;legend&gt;Account Information&lt;/legend&gt;
                      &lt;p&gt;
                          &lt;asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName"&gt;Username:&lt;/asp:Label&gt;
                          &lt;asp:TextBox ID="UserName" runat="server" CssClass="textEntry" EnableViewState="False"&gt;&lt;/asp:TextBox&gt;
                          &lt;asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" 
                               CssClass="failureNotification" ErrorMessage="User Name is required." ToolTip="User Name is required." 
                              &gt;*&lt;/asp:RequiredFieldValidator&gt;
                      &lt;/p&gt;
                      &lt;p&gt;
                          &lt;asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password"&gt;Password:&lt;/asp:Label&gt;
                          &lt;asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password" EnableViewState="False"&gt;&lt;/asp:TextBox&gt;
                          &lt;asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" 
                               CssClass="failureNotification" ErrorMessage="Password is required." ToolTip="Password is required." 
                              &gt;*&lt;/asp:RequiredFieldValidator&gt;
                      &lt;/p&gt;
                      &lt;p&gt;
  
                          &lt;asp:CheckBox ID="chkRememberMe" runat="server" Text="Remember Me" 
                              TextAlign="Left" /&gt;
  
                      &lt;/p&gt;
                  &lt;/fieldset&gt;
                  &lt;p class="submitButton"&gt;
                      &lt;asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In" 
                           onclick="LoginButton_Click"/&gt;
                  &lt;/p&gt;
              &lt;/div&gt;
  
  
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>Can anyone wrap their heads around this?
  If any other information is needed then just ask and i will edit this question,</p>
  
  <p>Cheers</p>