views:

135

answers:

1

I've just finished reading http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-2-modelmetadata.html In the article Brad lists the Watermark property but there is no mention of which DataAnnotation is used to populate it.

A: 

There's no annotation supported by MVC 2 out-of-the-box that will set this property. In MVC 3, it will be settable via [Display(Prompt = "...")].

If you want to use DataAnnotations4 attributes (like [Display]) in MVC 2, you need to use MVC Futures AspNet4. See http://weblogs.asp.net/rajbk/archive/2010/04/27/localization-in-asp-net-mvc-2-using-modelmetadata.aspx for an example of how to hook everything up.

Levi