I have following model:
public class FormularModel
{
[Required]
public string Position { get; set; }
[Required]
[DataType(DataType.EmailAddress)]
public string Email { get; set; }
[Required]
public string Webcode { get; set; }
}
Required validation works fine. But when i try with DataType it doesn't react.
Here is my razor code for the email control:
@Html.TextBoxFor
(model => model.Email,
new { @style = "width: 175px;", @class = "txtField" }
) *
So, anyone know an answer?
TIA
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…