ASP.NET MVC Best Practices and Guidelines

June 22nd, 2015

I can't believe eight years have gone by since ASP.NET MVC first appeared. Today, I share some of the best practices and guidelines I've learned about ASP.NET MVC since it's release in December 2007.

8 Years.

ASP.NET MVC has been around for eight years and a lot of ASP.NET developers have embraced the new technology and shown what it's capable of in their own web apps.

While most developers were used to WebForms and Microsoft's stock controls (i.e. ListView and DataGrid), when developers moved to ASP.NET MVC, a number of developers were shocked because there wasn't enough meat for this to be a full-featured release.

But as time moved forward with each version, we started seeing a more thinner way of development rising to meet the challenge of users expecting fast, intuitive, maintenance-manageable, and standards-based web development with ASP.NET MVC. More controls were made to simplify development with each version, such as the WebGrid.

Over my years of ASP.NET MVC development, there were a number of developers posting content regarding MVC techniques. Some held true to this day, and some, well...needed refactoring.

Please note: Some of the guidelines I list below are based on my own experiences over the years since 2008.

Also, this will be a living document as I encounter more techniques and guidelines in my coding with MVC.

ASP.NET MVC Guidelines

Controllers

ActionResults

Action Filters

Views

ViewModels

Url Helpers

Html Helpers

Model Binders

Routing

Conclusion

While this is not, by far, a conclusive list of guidelines, these are the hard and fast rules that I've learned over the 8 years of ASP.NET MVC.

Here's to another 30 years of coding and learning even more (raising a beer).

I will be adding more as my MVC coding continues. If you feel there was a guideline or technique missing from this list, please let me know and I will make sure to add it.