ASPX FormsAuthentication.RedirectFromLoginPage function is not working anymore

Posted by Mike Webb on Stack Overflow See other posts from Stack Overflow or by Mike Webb
Published on 2010-03-23T18:05:31Z Indexed on 2010/03/23 19:23 UTC
Read the original article Hit count: 495

Filed under:
|
|
|
|

Here is my issue. I have an ASPX web site and I have code in there to redirect from the login page with the call to "FormsAuthentication.RedirectFromLoginPage(username, false);" This sends the user from the root website folder to 'website/Admin/'. I have a 'default.aspx' page in 'website/Admin/' and the call to redirect works on a previous version of the website we have running currently, but the one that I am updating on a separate test server is not working. It gives me the error "Directory Listing Denied. This Virtual Directory does not allow contents to be listed." I have this in the config file:

<authorization>
  <allow users="*" />
</authorization>

under the "authentication" option and...

<location path="Admin">
  <system.web>
    <authorization>
      <deny users="?" />
    </authorization>
  </system.web>
</location>

for the location of Admin.

Also, there is no difference in the code between the web.config, Login.aspx, or the default.aspx files on the current server and the one on the test server, so I am confused as to why the redirect will not work on both. It even works in the Visual Studio server environment, for which the code is also identical.

Any suggestions and help is appreciated.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about formsauthentication