Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News ASP.NET MVC 2 Feature Rundown

ASP.NET MVC 2 Feature Rundown

This item in japanese

ASP.NET MVC 2 is now ready for production use. Microsoft’s open source MVC framework is compatible with both .NET 3.5 and the soon to be released .NET 4. It compes with many new features including:

Templated Helpers allow you to automatically render view and edit HTML based on type-specific templates. Simply call Html.DisplayFor(expression) and the rendering engine will look up the matching template you previously defined.

Areas allow you to subdivide a project into smaller, more manageable sections. Each Area has its own collection of models, views, and controllers.

A known problem with ASP.NET scalability is the limited size of the thread-pool. While not an issue for CPU-bound requests, requests that are I/O bound can cause the server to run out of threads. Performance counters will show the server is idle, but yet it won’t be able to process requests. By using an Asynchronous Controller, developers can avoid tying up the thread pool.

Action-Method Parameters now support default values. In languages that support optional parameters (VB, C# 4+) this is done via the natural syntax. In older languages such as C# 3, the DefaultValueAttribute is used.

Basic validation rules can now be applied using the DataAnnotations attributes. This is used in conjunction with the Model-Validator Providers and the plugable client-side validation framework.

One of the somewhat ridiculous facets of the REST movement is that most browsers don’t actually support all the HTTP verbs needed for REST. Using the HttpMethodOverride helper method, the framework can emit a special hidden field to simulate REST verbs when making AJAX calls. While the real request is still a HTTP POST, the framework will automatically reroute the request to the correct PUT or DELETE action.

Rate this Article