Introduction to Mvc
* Introduction * Background * Tip 1: Seperate entities and models * Tip 2: Revalidate updated content * Tip 3: Securing your website * Tip 4: Always work with a DAL * Tip 5: Setting up a proper IoC dependency resolver * Tip 6: Use the MVC 4 Bundling feature in MVC 3 * Tip 7: Using MySQL as database (together with memberships) * Tip 8: Detect jQuery AJAX requests * Tip 9: Precompile the views to minimize errors * Tip 10: Using the TagBuilder * Tip 11: Include very useful extension methods * Tip 12: Attributes you should never forget * Tip 13: Be cautious with ForeignKeys * Tip 14: Working with localization - chances and pitfalls * Tip 15: Constraints for better routing * Tip 16: Be careful when using names for action parameters * Tip 17: Adding namespaces to views * Tip 18: Internal actions * Tip 19: Performance boost through caching * Tip 20: Override methods of your controllers * Tip 21: Your own membership provider * Tip 22: How to make HTTPS mandatory * Tip 23: Use T4MVC for strongly typed helpers * Using the code * Points of interest
Introduction
From the moment I saw ASP.NET MVC I knew that this is not only useful but highly powerful. However, with great power comes great responsibility (and in technology: great requirements), resulting in a steep learning curve. This article is not focused on professional ASP.NET MVC developers (I suppose they do know everything I will write in this article), but is dedicated to people who just started developing in ASP.NET MVC (3) or plan to do so.
Most tips and source codes will be focused on the MVC core while others are focusing on techniques that could be used in combination like the Entity Framework or the jQuery validation helper. This article will also contain more specialized topics like IoC with the Unity dependency resolver or working with MySQL databases instead of Microsoft SQL ones. Even though some tips