开发者

How do I populate the Watermark property on ModelMetaData?

I've just finished reading http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-2-modelmet开发者_高级运维adata.html In the article Brad lists the Watermark property but there is no mention of which DataAnnotation is used to populate it.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜