I have a website set up that has a web.config in the root directory. There are also 3 sub directories that each have a web.config that is used for permissions. My problem is that when I try to get the custom errors to work. I have the following code in the root level web.config.
When I receive a general error the Error.htm page works as it should. What I am trying to get to work is the 401.2 error page. In the subfolder the web.config looks like this:
How do I get the 401.2 error to use my Admin401.htm?
ASP.NETVisual Basic.NET.NET Programming
Last Comment
Paul MacDonald
8/22/2022 - Mon
us1975mc
ASKER
Forgot to mention that just before I get the 401 error I get the Windows Logon:
Another way to do this is to go into the properties for the site in IIS, and on the Custom Errors tab, change which page is displayed for the 401.2 error.
us1975mc
ASKER
paulmacd,
I tried both with no success. When I entered the code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then If Request.IsAuthenticated AndAlso Not String.IsNullOrEmpty(Request.QueryString("ReturnUrl")) Then Response.Redirect("~/TechError.aspx") End If End If End Sub
It does not seem to even see this. I get the same Sign In: and then I get the same error: When I went to the server administrators and they placed the error page on the property for the site in the IIS I received the following error: