Email model validation with DataAnnotations and DataType

前端 未结 4 1741
说谎
说谎 2020-12-01 06:08

I have following model:

public class FormularModel
{
    [Required]
    public string Position { get; set; }
    [Required]
    [DataType(DataType.EmailAddre         


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-01 06:39

    The DataAnnotationsExtensions project has an Email attribute that you can use.

提交回复
热议问题