Search code examples
asp.netexceptionunhandled

Handle unhandled exceptions in asp.net


How can we prevent page crash in asp.net? Is there any generic function or place like global.asax where we specify a file to redirect to when an unhanded exception occurs? (like we redirect to a specified page when 404 page not found exception occurs?


Solution

  • You can do it in Global.asax or you can set up custom error pages in web.config.

    ASP.NET Custom Error Pages