mvc3 DataAnnotations 有一个 Description 属性:
例如
[Display (Name="Title", Description="description about the title")]
public string Title { set; get};
在我看来,我想在 .blur 上使用 jquery 显示输入的描述文本。
<script type="text/javascript">
$(function () {
$("#title").blur(function () {
???
});
});
@Html.LabelFor(model => model.Title)
//description here, not sure how to map it.
@Html.LabelFor()//description would go here
@Html.TextBoxFor(model => model.Title)
@Html.ValidationMessageFor(model => model.Title)
谢谢!