Custom error configuration setting
-
Hi, I am implementing error handling in my website developed in ASP.Net MVC & C#. To do this, I have set CustomErrors attribute in my web.config file as below customErrors mode="On" defaultRedirect="Error.aspx" This should ideally redirect user to default error page which is present in Views/Shared/Error.aspx. This bebavior was working perfetly untill I changed the base class of my controller classes. Earlier, the base class was "Controller" but for some internal logic, I changed it to ControllerBase and my ControllerBase is now inherited from Controller class. For example HomeController : ControllerBase { ... ... } ControllerBase : Controller { ... ... } But now when I run the application and some unhandled error occurs, the user is not redirected to Error.aspx any more. Instead it gives error page as below. Even if I set custom errors mode to "On". ---------------------------------------------------------------------- Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL. ---------------------------------------------------------------------- Any help will be appreciated... Thanks Anil