Since ASP.NET MVC 1 reached its final release in April 2009, the developer community has been hard at work applying it to every conceivable task (and a few inconceivable ones). Through experience, we’ve established best practices, new design patterns, and new libraries and tools to make ASP.NET MVC development more successful.
Microsoft has watched closely and has responded by embedding many of the community’s ideas into ASP.NET MVC 2. Plus, Microsoft noticed that certain common web development tasks were harder than expected in ASP.NET MVC 1, so it has invented new infrastructure to simplify these tasks.
Altogether, the new features in ASP.NET MVC 2 are grouped around the theme of streamlining
“enterprise-grade” web development. Here’s a rundown of what’s new:
• Areas give you a way to split up a large application into smaller sections (e.g., having a public area, an administrative area, and a reporting area). Each area is a separate package of controllers, views, and routing configuration entries, making them convenient to develop independently and even reuse between projects.
• Model metadata and templated view helpers are extensible mechanisms for describing the meaning of your data model objects (e.g., providing humanreadable descriptions of their properties) and then automatically generating sections of UI based on this metadata and your own design conventions.
• Automatic HTML encoding (supported on .NET 4 only) means you can avoid cross-site scripting (XSS) vulnerabilities without remembering whether or not to HTML-encode each output. It knows whether you’re calling a trusted HTML helper, and will make the right encoding choice automatically.
• Asynchronous controllers are relevant if you must handle very large volumes of concurrent requests that each wait for external input/output operations (e.g., database or web service calls). These build on ASP.NET’s underlying IHttpAsyncHandler API, potentially boosting performance in such scenarios.
• HTTP method overriding is very neat if you’re exposing a REST-style interface to the Web with the full range of HTTP verbs such as PUT and DELETE. Clients that can’t issue these HTTP request types can now specify an override parameter, and then the framework will transparently accept that as the request’s HTTP verb.
• Strongly typed input helpers let you map input controls (e.g., text boxes or custom
templates) directly to your model objects’ properties with full IntelliSense and refactoring support.
• Child requests are a way to inject multiple extra independent sections into a page (e.g., a navigation menu or a “latest posts” list)—something that doesn’t otherwise fit easily into the MVC pattern. This is based on the RenderAction() mechanism previously included in the “MVC Futures” add-on for ASP.NET MVC 1.
Like any other version 2 product, there’s also a host of smaller improvements, including extra
extensibility options and performance optimizations. I will explain all the above areas one by one from my furture posts. Times up now!! Need to go to office.. catch u guys !! :)