帮助Web表单中的ComponentModel.DataAnnotations [英] help for ComponentModel.DataAnnotations in web form
本文介绍了帮助Web表单中的ComponentModel.DataAnnotations的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
[必填]
公共字符串电子邮件{get;组; }
正在工作
[RegularExpression]无效
[Required]
public string email { get; set; }
is working
[RegularExpression] is not working
推荐答案
你能否更具体地提出你的问题。我想下面是你问题的解决方案
Can you more specific on your question.I guess below is solution for ur issues
[Regular Ex pression( "^[a-z0-9_\\+-]+(\\.[a-z0-9_\\+-]+)*@[a-z0-9-]+(\\.[a-z0-9]+)*\\.([a-z]{2,4})
,ErrorMessage = 电子邮件格式无效。)]
这篇关于帮助Web表单中的ComponentModel.DataAnnotations的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文