In this article, we will learn how we can manage the user screen of our website when runtime error occurs.
By default, Visual studio throws an ugly "yellow screen of death (YSOD)" at the time of runtime errors. We can manage it by applications <customErrors> configuration.

This yellow screen of death show what kind of error is this, also shows details of exception which is quite useful from the point of developers, by which they can go through that error details and debug their application accordingly but from the end user's point of view this YSOD is nasty.
At this moment developer can handle how users are shown a better error page by configuring <customError> in web.config page. There are couple of attributes we need to set.
We need to provide the following attribute value:
- defaultRedirect
- mode
- <configuration>
- <system.web>
- <compilation debug="true" targetFramework="4.5" />
- <httpRuntime targetFramework="4.5" />
- <customErrors mode="" defaultRedirect=""></customErrors>
- </system.web>
- </configuration>
DefaultRedirect
Here we pass the URL of custom error page.If we want to redirect to our custom error page instead to that annoying Yellow Screen Of Death(YSOD).
Here we pass the URL of custom error page.If we want to redirect to our custom error page instead to that annoying Yellow Screen Of Death(YSOD).
This is optional attribute.
Mode
There are 3 mode depending upon where the user visited that screen locally or remotely.
There are 3 mode depending upon where the user visited that screen locally or remotely.
- on
- off
- RemoteOnly



Dinesh GabhanePosted Nov 11, 2019, 1:26 AM
Thanks for nice share
rohit potdarPosted Mar 26, 2018, 3:13 AM
Hi shridhar i want to keep hide when we will type e.g. www.mydomain.com/aux then i seen this Server Error in '/' Application.Runtime Error ...my query is that '/' hide this can we possible this ...please reply me
Santhakumar MunuswamyPosted Sep 17, 2015, 10:39 AM
Thanks for nice share
Shridhar SharmaPosted Sep 14, 2015, 10:41 AM
Thank you all for nice words. :)
Raja TPosted Sep 14, 2015, 7:14 AM
Nice one ...Thanks for sharing
Vipul MalhotraPosted Sep 14, 2015, 4:22 AM
nice article
Muhammad Aqib ShehzadPosted Sep 14, 2015, 4:00 AM
nice one
Humayun Kabir MamunPosted Sep 14, 2015, 1:40 AM
Nice...
Harshad PansuriyaPosted Sep 14, 2015, 12:28 AM
Nice One
Saineshwar BageriPosted Sep 13, 2015, 11:49 PM
Good One Shridhar
Jaipal ReddyPosted Sep 13, 2015, 11:02 PM
Nice one.
Sumit JoshiPosted Sep 13, 2015, 2:03 PM
good one.
Karthikeyan KPosted Sep 13, 2015, 12:40 PM
Good one sir...Thanks for sharing
Rajeesh MenothPosted Sep 13, 2015, 6:52 AM
Thanks for sharing..
Gopi ChandPosted Sep 13, 2015, 5:52 AM
Good one
Pankaj Kumar ChoudharyPosted Sep 13, 2015, 4:46 AM
Nice Article Sir.........