Templated Helpers and Custom Model Binders in ASP.NET MVC 2

added by gshackles
3/24/2010 7:14:53 PM


One of the really cool new features in ASP .NET MVC 2 is templated helpers. The basic idea is that you can define a template for either displaying or editing a particular data type, and it will be used by default when displaying or editing that type. This allows you to define the behavior once, and then you don’t need to worry about it in every view you write thereafter. In this post I’ll go over how to use templated helpers to handle both a built-in type, DateTime, as well as a custom type which will demonstrate using a custom model binder.