title: Login Page in ASP.NET application with FormsAuthentication access denied
body: <p>I've got a webapp running that needs users to login.
  Webconfig:</p>
  
  <pre><code>    &lt;!--Logging in stuff--&gt;
      &lt;authentication mode="Forms"&gt;
          &lt;forms loginUrl="login.aspx" timeout="2880"/&gt;
      &lt;/authentication&gt;
      &lt;authorization&gt;
          &lt;deny users="?"/&gt;
      &lt;/authorization&gt;
  </code></pre>
  
  <p>And in the login.aspx page (doubled checked the name) I have the following logic after verifying the user credentials using my own database:</p>
  
  <pre><code>    if (checkCredentials.searchCredentials(attemptedName, passwordBox.Text) != null)
              {
                  FormsAuthentication.RedirectFromLoginPage(attemptedName,false);
              }
  </code></pre>
  
  <p>I know the if statement works, as it did with a previous method I used for logging in.</p>
  
  <p>However, when I run the application, the login page opens up immediately with error 401.2. Help would be much appreciated :)</p>