I want to add a friendly error page to my application that would say a text like, “Oops some thing went wrong”. I want the error page to be displayed automatically for every page of my application in the even of an exception. How can I achieve this?
Share
Simply enable custom errors in web.config:
and the
~/Views/Shared/Error.aspxview will be rendered on unhandled error (assuming your controller is decorated with the[HandleError]attribute).Then you can have more fine grained control and different views for different exceptions: