473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

customError - 401.2 Access Denied

I'd like to avoid displaying the nasty built-in ASP.NET error for a 401.2,
access denied. We're using windows authentication. The error message that
is displayed by default is printed below. I'd love for it to redirect to
the 401-2_access_denied.htm file I've created in the root of my web site.
The text below is from my web.config file.

<customErrors defaultRedirect="error.htm" mode="On">
<error statusCode="401.2" redirect="401-2_access_denied.htm"/>
</customErrors>

1. I've tried a statusCode of 401, 401-2, and 401.2.
2. I've tried absolute and relative paths to the .htm file. Relative should
work just fine as the web.config and .htm file are both in the root of the
site.
3. IIS custom errors do not appear to be leveraged whatsoever in this
situation when modified.

Suggestions?

Thanks in advance.
Mark

*** ASP.NET ERROR ***

Access is denied.
Description: An error occurred while accessing the resources required to
serve this request. The server may not be configured for access to the
requested URL.

Error message 401.2.: You do not have permission to view this directory or
page using the credentials you supplied. Contact the Web server's
administrator for help.
Nov 18 '05 #1
3 3963
Hi,

The problem is that IIS check and found unauthorized access and redirect
to the page that set in IIS metadata. Your application not even called.
If you want to change that page you need to change IIS metadata. You can
do it by using IIS MMC. get application properties and in custom error
tab change 401.2 to your own file.

HTH
Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2
Unfortunately, I tried this technique already and it appears to have zero
impact. For the 401.2 error, I modifed the file path in IIS to be
C:\WINDOWS\Help\iisHelp\common\401-2_access_denied.htm for the virtual
directory that my project is in. The file is a very simple html error page
containing only text. It still redirects to the original error message.
Moreover, this authentication is maintained by ASP.NET in the web.config, so
I don't see how IIS's custom errors would impact this. Any other ideas? The
original thread is below.

Thanks again.

Mark Field
fi******@umn.edu

"Natty Gur" <na***@dao2com.com> wrote in message
news:#X**************@TK2MSFTNGP10.phx.gbl...
Hi,

The problem is that IIS check and found unauthorized access and redirect
to the page that set in IIS metadata. Your application not even called.
If you want to change that page you need to change IIS metadata. You can
do it by using IIS MMC. get application properties and in custom error
tab change 401.2 to your own file.

HTH
Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


I'd like to avoid displaying the nasty built-in ASP.NET error for a 401.2,
access denied. We're using windows authentication. The error message that
is displayed by default is printed below. I'd love for it to redirect to
the 401-2_access_denied.htm file I've created in the root of my web site.
The text below is from my web.config file.

<customErrors defaultRedirect="error.htm" mode="On">
<error statusCode="401.2" redirect="401-2_access_denied.htm"/>
</customErrors>

1. I've tried a statusCode of 401, 401-2, and 401.2.
2. I've tried absolute and relative paths to the .htm file. Relative should
work just fine as the web.config and .htm file are both in the root of the
site.
3. IIS custom errors do not appear to be leveraged whatsoever in this
situation when modified.

Suggestions?

Thanks in advance.
Mark

*** ASP.NET ERROR ***

Access is denied.
Description: An error occurred while accessing the resources required to
serve this request. The server may not be configured for access to the
requested URL.

Error message 401.2.: You do not have permission to view this directory or
page using the credentials you supplied. Contact the Web server's
administrator for help.
Nov 18 '05 #3
Hi,

Read the following link to understand that IIS do perform authentication
tasks before the request handed to ASP.NET. :
http://msdn.microsoft.com/library/de.../en-us/dnnetse
c/html/SecNetch09.asp

Are you using URL or File to set your custom error page?

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: calfdog | last post by:
Hello, Does anyone know a workaround for calling fireEvent. With the latest from Microsoft OS XP2 and Hot fixes to IE it now gives an "access denied" error in Python when called. Here is what...
0
by: Steve | last post by:
Hi, Yesterday I signed up for another dedicated linux server with the hosting company I use and I am having problems getting MySQL 4.1.3 working on it. I've tried just about everything I can...
9
by: | last post by:
Hi All, I have allready tried to ask a similar question , but got no answer until now. In the meantime, I found, that I cannot understand some thread-settings for the Main() function . If I use...
0
by: Mark | last post by:
I'd like to avoid displaying the nasty built-in ASP.NET error for a 401.2, access denied. We're using windows authentication. The error message that is displayed by default is printed below. I'd...
0
by: ASP.Confused | last post by:
The old message looked a little stale, so I am re-posting it here. Anybody have any ideas of what I could do?!? The previous responses to this question are below. If you want to look at the...
12
by: Ron Weldy | last post by:
I have a test server runinng 2003/IIS 6 with a mixture of asp and asp.net files. On my workstation I have a share set up to the folder where the web files reside. I am just doing quick and dirty...
3
by: Shailesh Humbad | last post by:
I figured out what was causing the "Access is Denied" error when calling functions from referenced DLLs in my service. I've tried to be very detailed, so bear with me. It turns out that...
8
by: Jeremy Ames | last post by:
I am trying to move an application from my system to a new test system. I really should have tried an easier program first, but I didn't really have a chance. My application was originally written in...
0
by: Andy | last post by:
Thanks Peter, I thought I'd give an update on this problem. My application had 2 assemblies that contained classed for the Data access and business logic layer. It was on one of them that I was...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.