BT

ASP.NET MVC 2 Feature Rundown

| by Jonathan Allen Follow 611 Followers on Mar 17, 2010. Estimated reading time: 1 minute |

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 Stage
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.

Tell us what you think

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

Email me replies to any of my messages in this thread
Community comments

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

Email me replies to any of my messages in this thread

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

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT