我在 asp.net MVC3 中有一个未映射的字段。我想显示此字段所需的消息,但我不能。如何显示未映射字段所需的消息?可能吗 ?
[Required(ErrorMessage = "Email alanı girilmelidir.")]
public string FirstEMail
{
get
{
return first_email;
}
set
{
first_email = value;
}
}
达尔:
modelBuilder.Entity<AbsKontak>().Ignore(p => p.FirstEMail);
看法:
Html.LabelFor(p => p.FirstEMail)
Html.TextBoxFor(p => p.FirstEMail, new { class = "medium", disabled = "disabled", id = "txtFirstTel" })
Html.ValidationMessageFor(p => p.FirstEMail)