日期:2014-05-17 浏览次数:20486 次
/// <summary>
/// 邮箱地址
/// </summary>
[Display(Name="邮箱地址")]
[Required(ErrorMessage="邮箱地址必须输入!")]
[DataType(DataType.EmailAddress)]
[RegularExpression(@"^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$", ErrorMessage = "邮箱格式不正确!")]
[Remote("IsExists","Account",ErrorMessage="该邮箱已被注册!")]
public string Email { get; set; }
<div class="editor-label">
@Html.LabelFor(model => model.Email)
</div>
<div class="editor-field">
@Html.TextBoxFor(model => model.Email)
@Html.ValidationMessageFor(model => model.Email)
</div>