I think I have figured this out. I am using forms authentication which is
the problem.
The first test I made was on the 2nd page after the login page so the user
had logged in, went to my test page and got the test error. At this point
they were redirected to the error page but no matter what
server.GetLastError() returned null, not sure why.
I moved the test error to the login page. So when the login page comes up,
the error takes place and is redirected to the DsAppError.aspx but they have
not been authenticated so they are sent back to the Login.aspx but that is
where the error is. I am assuming that something is detecting the circular
page reference and stopping it and telling the user (me) to change the
web.config. But the real problem is the circular page reference.
I am not sure what authentication is the best way. I am taking users to the
login page to ask for user name and password and I am then going to check
that information against a table in SQL Server. It will not be the login to
sql server as that will be a fixed value but will be checked against a data
table.
Is there a better mode basic authentication for this setup than Forms
authentication or can I simply make the DsAppError.aspx a form that does not
recquire authentication?
"Steven Cheng[MSFT]" <v-schang@online.microsoft.com> wrote in message
news:8Z6xMTk2DHA.3088@cpmsftngxa07.phx.gbl...[color=blue]
> Hi Nick,
>
>
> Thank you for using Microsoft Newsgroup service. From your description,
> you're wanting to set a custom error page in an ASP.NET web application
> which will be shown for the remote client user when error occurs. And you
> set the "customErrors" element as :
> <customErrors defaultRedirect="DsAppError.aspx" mode="RemoteOnly"/>
> in the web.config file. However, you found this didn't work. Is my
> understanding correct? If anything wrong, please feel free to correct me.
>
> Firstly, I'm sure your original setting as "<customErrors
> defaultRedirect="DsAppError.aspx" mode="RemoteOnly"/>" is quite correct.[/color]
So[color=blue]
> I do feel abit strange as it doesn't work. Would you please try out the
> following tests:
>
> 1. change the "mode=" as "On" and see whether it display the custom error
> page("DsAppError.aspx") both on local or remote client?
>
> 2. If still fails to work, I think you may have a check on the error
> page("DsAppError.aspx"), is it accessable or if there is something
> incorrect with the error page? For example, you can try setting the
> defaultRedirect page as
> defaultRedirect="http://localhost/appname/DsAppError.aspx" to specify the
> full path.
>
> 3. If still with no success after the above steps, would you try creating
> another simple web application and provide a simple error page and set the
> web.config as
> "<customErrors defaultRedirect="customerrorpagename" mode="RemoteOnly"/>"
>
> Also, you may try rebooting the IIS server. Or check the server[/color]
enviroment.[color=blue]
> Please try out the preceding suggestion. If you have any quesions or need
> any help, please feel free to post here.
>
>
>
> Regards,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure!
www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>[/color]