开发者

Validation in ASP.net

开发者 https://www.devze.com 2022-12-23 01:39 出处:网络
I want only letters and the special symbols / and - in my textbox. How should be the expre开发者_JAVA技巧ssion like to give in custom validator?

I want only letters and the special symbols / and - in my textbox.

How should be the expre开发者_JAVA技巧ssion like to give in custom validator?

Thanks In Advance


You should use a RegularExpressionValidator.

The expression should be something like ^[a-zA-Z/\-]+$

If the text cannot be empty, you need a RequiredFieldValidator aswell, as all the other validators are only called if the text is not empty.

0

精彩评论

暂无评论...
验证码 换一张
取 消