Use T4MVC to eliminate all magic strings and magic anonymous types in your entire project. This will help you in refactoring later in your project, and (apart from having to still ensure your routes are well-defined) all Action calls get their proper parameters. It changes calls like this:
<%= Html.ActionLink("Link text", "Products", "Details", new { id = Model.Id }) %>
Into:
<%= Html.ActionLink("Link text", MVC.Products.Details(Model.Id)) %>
Keep any and all logic out of your view. Your controller should determine what gets shown - your view should be dumb.
ViewModel DTO objects:
BaseViewModel abstract class, with properties for rendering page meta data, menus and all other stuff that appears on every page. All other ViewModel classes inherits from BaseViewModel.
While not a best practices site, the below site is doing great things with asp.net MVC that could probably be considered best practice.
http://www.codeplex.com/MVCContrib
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With