Is there a way to display a benign error page (using some settings in web.config) when an asp.net app crashes ?
I have an app whose database is updated regularly. If the database is updated while a user is using the app, frequently the app crashes. If the app’s webpage is refreshed then everything is OK again.
How best to handle a situation like this? Is there a way to direct all crashes to a webpage that tells the user to just refresh? Thanks.
Yes, you can define and turn on custom error pages.
Set the
modetoOnfor all requests orRemoteOnlyto enable custom errors only on remote requests. Then define as many error pages as you need for the various errors.While you are updating your application, you might consider placing an
app_offline.htmfile in the root of your web app. If that file is present it is shown for all incoming requests. See http://weblogs.asp.net/scottgu/archive/2006/04/09/442332.aspx for more info.