开发者

ASP.NET MVC 2 blog post seems to discuss nonexistent attributes

Reading this Brad Wilson blog post, I'm coming across several attributes开发者_高级运维 (e.g., DisplayFormatString, EditFormatString, ShortDisplayName, SimpleDisplayText) that seem to have no available documentation, and I'm having no luck figuring out what namespace they belong to.

Do these attributes even exist? Have they been replaced by different attributes? What's going on here?


I don't think there are attributes for these fields. That list is a list of properties found on ModelMetadata, and my guess is the default Data Annotations metadata provider doesn't populate those. You can build some custom attributes, and a custom metadata provider without to much fuss or muss. You can also populate that field from procedural code anywhere you have the ViewData instance.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜