requiredfieldvalidator和regularexpression验证器都不能一起工作 [英] Both requiredfieldvalidator and regularexpression validator not working together

查看:60
本文介绍了requiredfieldvalidator和regularexpression验证器都不能一起工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个登录页面。

i我在同一个文本框中使用asp.net requiredfieldvalidtaor和reularexpression验证器。



问题是那个,只有requiredfield验证器被解雇了。而不是正则表达式。





例如:



email :left empty.hence requiredfield将开火





电子邮件:abc @ dfbmw regularexpression不会开火。











如果单独使用但使用时两者都工作正常一起出现问题。

i have a login page.
i am using asp.net requiredfieldvalidtaor and reularexpression validator on the same textbox.

The problem is that ,only requiredfield validator is getting fired. and not the regular expression.


For Example:

email: left empty.hence requiredfield will fire


email: abc@dfbmw regularexpression will not fire.





Both are working fine if used seperatly but when used together,the problem arises.

推荐答案

请参阅此链接...



以便更好地了解验证。



http://www.w3schools.com/aspnet /aspnet_refvalidationcontrols.asp [ ^ ]

了解ASP.NET验证技术 [ ^ ]



我认为在你的情况下根据Nandakishorerao评论,你忘了在结账时设置验证组属性。
Refer this links...

for better understanding about validations.

http://www.w3schools.com/aspnet/aspnet_refvalidationcontrols.asp[^]
Understanding ASP.NET Validation Techniques[^]

I think in your case as per "Nandakishorerao" comment , you forgot to set validation group property once checkout that .


这篇关于requiredfieldvalidator和regularexpression验证器都不能一起工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆