ASP.NET MVC 2 – Preview 1

It’s out. You can download it from here. Some of the new things it includes (“extracted” from the readme for your convenience):

 

  • Areas: When creating larger ASP.NET MVC applications, you tend to create controllers and views that might be named the same but belong to different aspects of the application (for example you might have a HomeController for Customers and one for Administration). Areas allows you to create “sub-projects” inside your project to group these.

 

  • [HttpPost]: Shortcut for putting [AcceptVerbs(HttpVerbs.Post)]

 

  • DataAnnotations: The default model binder supports DataAnnotations for validation

 

  • DefaultValueAttribte: For types of Int32, DateTime or Guid’s you can now specify a default value on the action declaration to better comply with your routing patterns.

 

  • Supprot for byte[] and Data.Linq.Binary: Default Model binder now supports these types.

 

  • API improvments

 

  • Templated Helpers: Basically allows you to associate types to certain elements for display/editing.

 

The only breaking changes it seems is introduction of the Area keyword and a signature change in DefaultControllerFactory. That means if you’re using a custom controller factory for IoC for example (and if you’re not, you should be), you’ll need to update your app.

There’s nothing in the README regarding the inclusion of the strongly-typed helpers from the Futures assembly or any new strongly-typed Html Helpers for element rendering. Not sure if they are included in this assembly or might come in the next preview.

Now to go play with it a little…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s