使用脚本进行验证控制 [英] validation control using script
问题描述
大家好,
我正在使用vb.net(ASP.NET)进行一个项目,因为我在注册页面上有一个douts,该字段为
输入您的电子邮件ID = ------------//(文本框)
在使用验证控件(使用脚本)的情况下,当我输入无效的ID(例如:abc)时,它显示输入了您的有效电子邮件ID,再次输入了有效的邮件ID(例如:abc@gmail.com),页面将执行,但是我喜欢的是当我输入一个电子邮件ID时,例如:abc@gmail.commu,
在页面中也执行该操作,我不知道为什么上述邮件ID是否有效,请为此提供一些解决方案..
Hi all,
I am doing one project using vb.net(ASP.NET) in that i have one douts in registration page, where the field is,
enter your email id =------------ //(textbox)
in this am using validation control (using script), when i enter invalid id( eg:abc) it showing enter your valid email id,again i had enter valid mail id (eg:abc@gmail.com) the page would execute, but my dout is when i enter one email id like eg: abc@gmail.commu,
which is also execute in the page ,i dont know why whether the above mentioned mail id is valid or not, please give me a drop of solution for this its very urgent..
thanks in advance..
推荐答案
U可以使用正则表达式验证器控件来达到目的.
通过以下作为验证表达式
Hi U can use Regular Expression Validator control to acheive this.
pass following as validation expression
ValidationExpression="^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})
这篇关于使用脚本进行验证控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!