ASP.NET MVC Preview Release 4

Microsoft ASP.NETTo my delight I noticed that during my vacation the ASP.NET MVC Preview Release 4 have been released. This is nice since I’ve been trying to wrap my head around this framework for a project I’m currently working on.

The MVC framework certainly solves a lot of the issues I have with ASP.NET and actually makes it possible to create standard compliant websites without having to bend over backwards with all the awkward quirks of the ASP.NET Web Forms model.

Scott Guthrie has written about the new release, describing what’s different from the last one. One thing that I found particular nice is that it’s now really easy to implement functions for handling logins and such. The new template even includes basic examples that you can easily adapt to your own needs.

Action Filter Attributes

Action filters is a way to intercept an Action Method and perform something before and/or after it has been executed. They are not new since they been around since preview release 2, but the news is that there are some really useful ones built in. You can also easily make your own.

They are very easy to use. You just define them on a class within a Controller or directly on an Action Method like this:

[FilterName]
Public Class ClassName : Controller
{
[FilterName]
public object MethodName()
{
//Code...
return View();
}
}

Two of the built in filters I find most interesting are the OutputCache Filter and the Authorization Filter. The OutputCache Filter enables you to easily cache certain content via ASP.NET’s output cache features. The Authorization Filter lets you integrate authorization control on different content in a very simple manner. This in combination with the built in user handling makes it really easy to build websites with login functionality.

To read more about these enhancements and others, visit Scott Guthris blog.

Download ASP.NET MVC Preview Release 4 from Codeplex.

About the author

Gabriel Svennerberg is an UX Designer and FrontEnd Developer living in Sweden. When he's not busy designing or building applications at Meetod, he writes about UX Design and all things web on In usability we trust. Gabriel is the author of the book Beginning Google Maps API 3 published by Apress. Gabriel on Google+
  • Peter Karlsson

    Can’t believe you are falling for Microsoft products again. Aptana Jaxer and “Cloud Computing” is the future my friend.

  • http://www.svennerberg.com Gabriel Svennerberg

    I don’t really see a contradiction between ASP.NET MVC and Cloud Computing. It should be possible to combine the two! ;-) You should try the MVC framework. It might be a revelation for you too!

    But seriously, I got to find the time to dig into Jaxer. It seems to be a pretty interesting technology.