HACKER SAFE certified sites prevent over 99.9% of hacker crime.
Microsoft Certified Partner.
Microsoft ASP.Net Hosting Advantage Member.
Community Server Certified Host

How to fix Access Denied 401.2 in ASP.Net

You may get the following type of error (screen shot below) or you may get a black and white error page from IIS about 401 Access denied.

Your code ran fine on your computer for testing, but once you upload it to your ASP.Net web host, you start getting this error about Access Denied 401.

One possible cause is that the server does not have permissions configured on the folder you are trying to access, but most web host have the correct permissions set to allow anonymous access, so before you blame the server, check your web.cofig file to see if you are denying anonymous users from accessing your site (see offending code below the image).

Access Denied 401.2
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
   <appSettings/>
    <connectionStrings/>
    <system.web>
     <authorization>
      <deny users="?" />
      <allow users="*"/>
    </authorization>
    </system.web>
</configuration>

To Fix 401 Access Denied:

  • Remove the red line above from your code completely and test your site again. This does change the rules of access for your site, so you should refer to MS documentation about ASP.Net authorization and learn how to properly accomplish your goals of securing your website..
Is your domain available?
http://www.


Money back guarantee.
ASP.Net web hosting.
ASP.Net 2.0 web hosting.
ASP.Net 3.5 web hosting.
AJAX Installed.
Silverlight Hosting.
SQL Server 2005 hosting.
DotNetNuke web hosting, free installation.
Tandem Server web hosting, free installation.

If you need a tennis partner, then you go to TennisPulse.org, and when TennisPulse.org needs a web host, they come to Aquest Hosting.

www.TennisPulse.org
Community Server 2007 hosting with free installation.
Windows 2003 Server web servers.
Powered by ASP.Net 2.0.
Copyright © Aquest Hosting 2003 - 2007