How can I set a RegularExpression data annotation's regular expression argument at runtime?

前端 未结 4 1468
长发绾君心
长发绾君心 2020-12-15 06:08

We manage several ASP.NET MVC client web sites, which all use a data annotation like the following to validate customer email addresses (I haven\'t included the regex here,

4条回答
  •  孤街浪徒
    2020-12-15 06:50

    Checkout ScotGu's [Email] attribute (Step 4: Creating a Custom [Email] Validation Attribute).

提交回复
热议问题