【发布时间】:2010-09-14 10:25:53
【问题描述】:
还有 DisplayName 例如。
[DisplayName("Address line 1 ")]
public string Address1{get; set;}
Html.LabelFor(model => model.Address1)
我需要显示工具提示,例如。
[DisplayName("Address line 1 ")]
[ToolTip("The first line of your address as it appears on you bank statement")]
public string Address1{get; set;}
Html.LabelFor(model => model.Address1)
Html.ToolTipFor(model => model.Address1)
我可以扩展 DisplayName DataAnnotation 来执行此操作吗?我看不出它是怎么做到的。
谢谢!
【问题讨论】:
-
为了澄清,工具提示可能不会直接显示在标签旁边。
标签: asp.net-mvc data-annotations