Book now with code EOY2025
sting_224 wrote: » Hi All, I've been trying to lunch an asp.net application for days now with no joy. I keep getting 'Directory Listing Denied This Virtual Directory does not allow contents to be listed.'(on firefox) or 'You are not authorized to view this page' (on IE). I'm using IIS 6 on windows server 2003. I've had no problem running this application on windows 7 or server 2008. Any ideas on to make it work? Thanks.
RobertKaucher wrote: » What is the name of your primary page in the app? It needs to be default.aspx for an ASP.NET application. If it is not when you go to http://myap/ and IIS looks for the default page it does not find it an assumes you want a list of the directory. Since that is not allowed by default, and I would argue should not be enabled without good reason, it throws an error.
sting_224 wrote: » What I expect is that when for example i type IANA — Example domains in my browser, i get redirected to the login page IANA — Example domains. With the directory browsing checked, all i see is the website files like Admin.aspx, Analyser.aspx, login.aspx like i'm browsing an ftp site.
if (User.Identity.IsAuthenticated == false) { Response.Redirect("URL_to_RESOURCE"); }
sting_224 wrote: » Before my post I added default.aspx manually and moved it up but still got this error. I was wondering if I had to do it manually or if it is done automatically.
RobertKaucher wrote: » The login redirect is done programmatically via if (User.Identity.IsAuthenticated == false) { Response.Redirect(); } The main page, usually called default.aspx, must be present as I stated in my previous post. If you do not have a default main page configured you will just get a directory list. You should TURN OFF directory listing, btw. Ensure whatever page you expect to be the main page people view after logging in is configured as the default page in IIS.
if (User.Identity.IsAuthenticated == false) { Response.Redirect(); }
sting_224 wrote: » Redirect works when I run the website on win7 or win server 2008 IIS7 so I guess redirect has been sorted out. Now I'm trying to run it on server 2003 iis6. I added the default.aspx in iis under the Documents tab of the properties of the website.
RobertKaucher wrote: » Yeah, you're right. That's what I was getting at. You'll need to add a programatic redirect to default.aspx or stick with IIS 7+.Configuring Authentication in IIS 7
sting_224 wrote: » oh sorry, now I think I get you.
Use code EOY2025 to receive $250 off your 2025 certification boot camp!