Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
Hi everybody,

I want to CustomErrorPage in my ASP.Net application when any error happen with Users

Example: When try to access Database and the connection is failed, i want to go to Error Page,

I try to use web config file like that:

HTML
<customErrors mode="On" defaultRedirect="/customErrorPage.aspx">
                        <error statusCode="404" redirect="/404ErrorPage.aspx" />
                </customErrors>


but it not help, and the error is rasied by Visual Studio itself,

and it still display either The Exception Details Yellow Screen of Death error page or The Runtime Error Yellow Screen of Death error page,

I want to see my customErrorPage.aspx is displayed when failed to connect ot database.

Thanks
Posted
Comments
virang_21 18-Dec-11 0:52am    
in your web.config file set debug="false"... which is by default true.
MrLonely_2 18-Dec-11 2:38am    
I set it to false from long time, before i ask my first question here,
thanks virang_21
MrLonely_2 18-Dec-11 13:30pm    
any body here!

1 solution

You are redirecting error 404. It occurs when a requested page is not found.

To handle your kind of exceptions, trap error 500 (Server error)
Eg:
<error statuscode="500" redirect="ServerError.aspx" />
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900