假设这是我的模型
public class ValidationModel
{
#region Properties
[Display(Prompt = "type a PostCode here")]
public string PostCode { get; set; }
}
and this is my view
@using (Html.BeginForm())
{
@Html.LabelFor(m => m.PostCode)
@Html.TextBoxFor(m => m.PostCode)
}
有没有办法让它渲染出来?
<input data-val="true" id="PostCode" name="PostCode" placeholder="type a PostCode here" type="text" value="" />
即使从http://bit.ly/jVpM8X的文档中可以清楚地看到Display Prompt应该可以完成工作,但我仍然无法使其工作。