Introduction to Mvc

Topics: Source code, .NET Framework, ASP.NET Pages: 47 (11098 words) Published: June 22, 2013
* 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 might be irrelevant for some people and other tips might be known by other people, I considered them all worth to be written down. This article will not try to teach you MVC, HTML, JavaScript or CSS. In this article I will give you a series of (not-connected) tips, which could be helpful while dealing with ASP.NET MVC. Some of those tips might become obsolete with time, however, every tip will contain a lesson (or did contain one for me when I've been caught!). Background

ASP.NET MVC is probably the best approach for building dynamic webpages. Now this is kind of a strong sentence and there will be people, who will strongly disagree with that opinion. What makes ASP.NET MVC so good? On the one hand you can write it using C# (or VB.NET - but I strongly prefer C#). C# is a static type language which started as a kind of Java clone, but contains a lot more state of the art features nowadays. Even though the language is static you can access powerful features like reflection, dynamic variables and anonymous objects. Even anonymous methods, so called lambda expressions, are possible. All in all the language is very fast (for a managed language) and is JIT-compiled. Even though it is not possible to reach the level of performance as with C, you can easily reach a far better performance than with any scripted language. Now one might argue that performance is either not everything, or if it is, then you can always cross-compile to a binary. Here comes the second argument for ASP.NET MVC: since it is building up on the .NET / Visual Studio stack you can access a really good debugger and very good tools to get the job done. Now for years this has also been a kind of counter argument, since ASP.NET (now without the MVC) was a synonym to WebForms for most people. The WebForms stack is really powerful and deep, but had the disadvantage to eat performance and put you (the programmer) out of control. You just clicked around, programmed a bit etc., but the end-result (i.e. the markup)...
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • introduction Essay
  • Essay on Introduction
  • INTRODUCTION Essay
  • Introduction Essay
  • introduction Essay
  • introduction Essay
  • Introduction Essay
  • Introduction Essay

Become a StudyMode Member

Sign Up - It's Free