ASP.NET custom error page – Server.GetLastError() is null
I have a custom error page set up for my application:
I have a custom error page set up for my application:
I am trying to make a custom HTTP 404 error page when someone types in a URL
that doesn’t invoke a valid action or controller in ASP.NET MVC, instead of it displaying the generic “Resource Not Found” ASP.NET error.
i have successfully added a custom 404 page. what I want to do is to create another custom error page that is displayed when there is any error other than 404. e.g. 500, 403 etc.
For my website I configured some custom error pages.
If I generate a 404, the redirect works fine.
When hitting a 400, the “bad request” text shows up instead of the configured URl.
How can I set 404 and other error pages using web.config? I have tried adding following block in web.config.