Archive For The “ASP.NET MVC” Category
It’s no secret that I’m a big fan of the ASP.NET MVC Framework. One of the reasons I like it is because it’s opinionated – instead of leaving developers free to fumble things as they choose, it recognises that most projects will be more-or-less exactly the same, and imposes some conventions to keep everyone on [...]
There are already a couple of patterns for handling 404 errors in ASP.NET MVC.
- For invalid routes, you can add a catch-all {*url} route to match “anything else” that couldn’t be handled by any other route.
- For invalid controllers and controller actions, you can implement your own IControllerFactory with inbuilt error handling. Nicholas Smit describes one here.
But what happens when a user invokes a valid action on a valid controller, and the requested resource — product, article, sub-category etc — doesn’t exist? Let’s investigate some of the options available.
Following on from my post last week about consistent ASP.NET MVC URLs, here are a few tips that helped when I was first getting started with ASP.NET MVC and its URL routing system. Have you got your routes registered in the correct order? ASP.NET MVC checks incoming URL requests against routes in the order they [...]
Over the past couple of months, I’ve finally started work on my first web application built using the ASP.NET MVC framework. It’s going pretty well now, but at the start, in typical fashion, I spent more time googling and trawling message boards than actually cutting code. My first head-scratching moment was around the naming of [...]


