How to Handle errors with custom error pages in ASP.NET????

Posted by Shubham under ASP.NET on 3/10/2012 | Points: 10 | Views : 2249 | Status : [Member] | Replies : 3
hi respected...
i want to open a custom error page in every error may be possible so plzz help me to find the code in asp.net



plzz see the image
nd give me soln tag the code inside the response

Thanks&Regards:-
Shubham Choudhary
Software Engineer
www.facebook.com/shubham.kunar



Responses

Posted by: Vuyiswamb on: 3/10/2012 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
There is a Way

http://www.asp.net/web-forms/tutorials/deployment/displaying-a-custom-error-page-cs

Thank you for posting at Dotnetfunda
[Administrator]

Shubham, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sheonarayan on: 3/10/2012 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Hi Subham,

Read this article http://www.dotnetfunda.com/articles/article1070-error-logging-in-aspnet.aspx that has solution to all problems/questions related with error handling.

Hope this helps.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Shubham, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gsm_Gsv on: 3/10/2012 [Member] Starter | Points: 25

Up
0
Down
Step 1: Create a folder by name ErrorPages or Whatever name you want.
Step2: Include the following code in web.config

<system.web>

<customErrors mode="RemoteOnly" defaultRedirect="ErrorPage.aspx"/>
<error statusCode="404" redirect="404.aspx" />
<error statusCode="500" redirect="500.aspx" />
</system.web>


Note: You can change the mode = on/off

I suggest you to design your error page as per the color combinations that you have used in your web application.

Hope this will help you...

---------------------------------------
Live the life you've dreamed

Regards
MADHU

Shubham, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response