Software Engineer Problem Solver

Leo Reading

One Moment, Please...

Find My Articles

Share This Page

B l o g

Blog

Leo Reading

Software Engineer and Problem Solver From the USA

Download Resume

Error Pages Displaying posts tagged with Error Pages

Programming

Creating Static Error Pages Dynamically in MVC

Ben Foster has a great article on setting up custom error pages in an MVC project that I typically refer to each time I create a new one.  Recently, I've finally decided to work smarter, not harder, by setting up my own MVC seed project.  Of course, this should include some pre-defined error pages.  Unfortunately, error pages aren't exceedingly straight-forward.   Caveats There are two types of error pages that we need to consider: Errors handled by MVC, and errors handled by IIS This method will not correctly set the status codes (it will return 200 since you are being served a file) This solution hard-codes the URL.  That may or may not be acceptable for your application. Requires .NET 4.5.2+ Why Static HTML Files? In the event of an error in the MVC pipeline, IIS will not be able to serve an MVC page.  If this is the case, your application w...

Continue Reading


One Moment, Please

Close