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...
My Blog A collection of technical and non-technical mishaps, achievements and stories.
I get very excited about my side-projects, and have a tendency to rush into them. Unfortunately, I get distracted by something else that's shiney before I get them done, and I'm off to the next one. There's a folder of all of the projects...Posted on Thursday, May 12, 2016
I haven't posted an entry here in a while as I have a lot on my plate! I started a new job and am truly enjoying it. I work with a lot of very intelligent people, and am learning each and every day at a level that I haven't seen since I f...Posted on Friday, January 15, 2016
I'm working on a project that has an MVC Web API that lives on a different server from an MVC5 application that needs to consume the API. Because the user information is stored in the same database as the rest of the information that the API is...Posted on Saturday, September 12, 2015
A robots.txt file is important because it tells search engine crawlers what they should and should not crawl. Unfortunately, they don't always listen, but we should take advantage of the ones that do! In today's world, websites aren't sim...Posted on Tuesday, September 8, 2015