ASP.NET MVC 2 Released

MVC 2 has been released, I’ve been developing an application using the RC and I am very happy with the new features, there are so many, Areas, Auto-Scaffold UI Helpers with Template Customization which I just love.

I’ve just had to un-install my MVC 2 RC and install the official release of MVC 2 and it worked without any problems.

 

  • New Strongly Typed HTML Helpers
  • Enhanced Model Validation support across both server and client
  • Auto-Scaffold UI Helpers with Template Customization
  • Support for splitting up large applications into “Areas”
  • Asynchronous Controllers support that enables long running tasks in parallel
  • Support for rendering sub-sections of a page/site using Html.RenderAction
  • Lots of new helper functions, utilities, and API enhancements
  • Improved Visual Studio tooling support

 

To download click here

For more details check out Scott Gu’s blog on MVC 2 Released

enums with real world names

Enums are a wonderful addition to .Net, but won’t it be nice to have a real world description that you can display to the user interface? Well you can, and here is how define an attribute (or use existing DisplayNameAttribute) and annotate your enum with names as additional meta-data:

public enum Unit
{
    [DisplayName(“Hz”)] Hertz,
    [DisplayName(“%V”)] Volt
}

Conditional Breakpoints

I know that conditional breakpoints have been around for some time, I just keep forgetting how to set it, so I though it should be time write how to set a conditional breakpoint on my blog.

When you only want to break under certain conditions, you can right-click on a breakpoint red circle (or go to the Breakpoints Window and bring up the context menu on a given breakpoint) and select Condition to bring up the dialog box for conditional breakpoints. 

You’re given two options: break only when the specified expression is true or break only when the specified value has changed.  For this example, since I’m in a for loop, i’ll break when the value of result.Id == 22.

You’ll notice that the breakpoint circle now has a red plus on it to indicate it is conditional.