.NET, Archive, ASP.NET

Handling Unknown Controller Actions In ASP.NET MVC

In my last article I discussed how to use a wild card route to capture completely malformed URLs. But what if a URL matches to a controller in which the requested action cannot be found?

For example, when a visitor requests http://example.com/product/listing when there is no listing action on the product controller. In this example your visitor would be greeted by the a less than friendly page stating:

Server Error in '/' Application. The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. read more

Archive, ASP.NET, C#

Friendly 404 Errors In ASP.NET MVC

Custom file not found (404) error pages can help to create a more rewarding user experience for your site visitors. Links become outdated and there is nothing more frustrating for a user than to have found a link to exactly what they are looking for and to come across the infamous “file not found” screen. read more