Home > aspnet mvc > error page in asp.net mvc 3

Error Page In Asp.net Mvc 3

Contents

here for a quick overview of the site Help Center Detailed answers to any questions aspnet mvc nuget you might have Meta Discuss the workings and policies of this aspnet mvc source site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers aspnet mvc tutorial or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community

Aspnet Mvc 5

of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Custom error pages on asp.net MVC3 up vote 138 down vote favorite 116 I'm developing a MVC3 base website and I am looking for a solution for handling errors and Render custom Views for aspnet mvc 4 each kind of error. So imagine that I have a "Error" Controller where his main action is "Index" (generic error page) and this controller will have a couple more actions for the errors that may appear to the user like "Handle500" or "HandleActionNotFound". So every error that may happen on the website may be handled by this "Error" Controller (examples: "Controller" or "Action" not found, 500, 404, dbException, etc). I am using Sitemap file to define website paths (and not route). This question was already answered, this is a reply to Gweebz My final applicaiton_error method is the following: protected void Application_Error() { //while my project is running in debug mode if (HttpContext.Current.IsDebuggingEnabled && WebConfigurationManager.AppSettings["EnableCustomErrorPage"].Equals("false")) { Log.Logger.Error("unhandled exception: ", Server.GetLastError()); } else { try { var exception = Server.GetLastError(); Log.Logger.Error("unhandled exception: ", exception); Response.Clear(); Server.ClearError(); var routeData = new RouteData(); routeData.Values["controller"] = "Errors"; routeData.Values["action"] = "General"; routeData.Values["exception"] = exception; IController errorsController = new ErrorsController(); var rc = new RequestCon

here for a quick overview of the site Help Center Detailed answers to any questions you might have aspnet mvc 6 Meta Discuss the workings and policies of this site About Us

Aspnet Mvc Grid

Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with

Github Aspnet Mvc

us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just http://stackoverflow.com/questions/5226791/custom-error-pages-on-asp-net-mvc3 like you, helping each other. Join them; it only takes a minute: Sign up How do I display custom error pages in Asp.Net Mvc 3? up vote 23 down vote favorite 25 I want all 401 errors to be be redirected to a custom error page. I have initially setup the following entry in my web.config. http://stackoverflow.com/questions/6733064/how-do-i-display-custom-error-pages-in-asp-net-mvc-3 When using IIS Express I receive the stock IIS Express 401 error page. In the event when I do not use IIS Express a blank page is returned. Using Google Chrome's Network tab to inspect the response, I see that while the page is blank a 401 status is returned in the headers What I have tried thus far is using suggestions from this SO answer since I am using IIS Express but to no avail. I have tried using a combination and with no luck - the standard error or blank page is still displayed. The httpErrors section looks like this at the moment based on the link from the above SO question ( I also found another very promising answer however no luck - blank response)