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.
Directory Listing Deniedis an IIS error, stating that directory browsing on the server isn’t allowed. If you see this, it means when browsing toWebsite/Admin, the server isn’t finding any expected default documents and is then trying to show you the file directory through the browser (expected behavior). IIS is set to not allow this in your case (which is a good thing).Can you contact the server admins and ask them to verify the default documents for the website, and add
Default.aspxto the list? If not, at least find out what the default file names are in the site setup, and name your root page based on that.I think by default IIS uses
Default.htmand maybe one other. Even when registering asp.net with IIS, I don’t believeDefault.aspxis added. It has to be done manually.