Microsoft DevDays 2010 – MVC.NET 2

“ASP.NET MVC 2: Ninja Black Belt Tips” by Scott Hanselman

The last presentation I been to was, thankfully, a light presentation. It was a long day and I learned a lot already and another one of those sessions just would be too much. Scott brought his presentation wonderfully for this.

In his presentation he used many examples from his new version of nerddinner, which isn’t published yet, but can be retrieved from his site (though the use of SubVersion I believe he mentioned). Something I certainly will do and I can advise you to do too if you like to see a real life implementation of MVC.NET 2.

First thing he mentioned in his presentation was that current, MVC.NET 1 applications, heavily use HTML.Encode() a lot. Something they should by the way, but it was something that could also be made a lot prettier by the Microsoft team behind MVC.NET. They did! Instead of using the following:

<%= HTML.Encode(ViewData[“Message”]) %>

We can now do this, and it is exactly the same:

<%: ViewData[“Message”] %>

After this he gave many nice tips and tricks which I don’t think I should go into depth here, but you should Google the following things on Bing and check them out:

  • T4MVC (a text template)
  • MVCContrib (on codeplex)
  • Spark View Engine (a third party rendering engine)