BT

InfoQ Homepage News ASP.NET MVC 2 Feature Rundown

ASP.NET MVC 2 Feature Rundown

Bookmarks

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

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.