ASP.NET MVC Framework - Next CTP To Be Released At Mix 08 Conference

ASP.NET MVC Framework - Next CTP To Be Released At Mix 08 Conference

by David Hayden, Filed: Sarasota Web Developer

 

This probably doesn't come as too much of a surprise given that Microsoft likes to release products and product updates at their conferences, but Scott just announced that the next CTP of the ASP.NET MVC Framework will be released at the Mix 08 Conference.

 

Filter Attribute Support

I really dig the new Filter Attribute Support that will be in the next version. Scott mentions the following code snippet, for example, as a way to use the [OutputCache] filter attribute to output cache product listing page for 30 seconds at a time:

 

public class ProductsController : Controller {

    [OutputCache(Duration=30)]
    public void List()
    {
        // ...
    }

}

 

Nice. Or how about using an [Authorization] filter attribute to ensure that only a particular role has permissions to edit a product:

 

public class ProductsController : Controller {

    [Authorization(AllowRole="ProductManagers")]
    public void Edit()
    {
        // ...
    }

}

 

Granted we can already use PrincipalPermission as such:

 

public class ProductsController : Controller {

    [PrincipalPermission(SecurityAction.Demand,
        Role="ProductManagers")]
    public void Edit()
    {
        // ...
    }

}

 

but the key is the extensibility to add your own filters. Very cool.

 

Recent ASP.NET MVC Tutorials:

 

posted on Tuesday, February 12, 2008 6:15 PM

Main

News

Green Tea

.NET Development

Enterprise Library

Patterns & Practices