如何在asp.net中添加验证控件 [英] how to add validation controls in asp.net

查看:78
本文介绍了如何在asp.net中添加验证控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


任何机构都可以帮助解决这个问题.
我正在设计一种形式.在这种情况下,我有名字,中间名,姓氏之类的名字.在这些领域中,我想添加验证器,例如不允许使用2个字母,只允许使用字母和空格,不允许使用特殊字符.
我怎么能得到这个.


any body please help about this question.
i am designing one form.In that i am having feilds like first name,middle name,last name.in those feilds i want to add validators like 2 letters not allowed,only alphabtets are allowed and spaces,special characters not allowed like this.
how can i get this.

thanks in advance.

推荐答案

嘿,亲爱的,
第一次尝试google来回找到第二个结果1,170,000,
我个人推荐此代码项目有关使用验证控件的文章
ASP.NET中的Validator控件 [
Hey dear,
first try google fro this found 1,170,000 result within second,
I personnally recomment a this article of code project for using validation controls
Validator Controls in ASP.NET[^]
This article rpovide even code that you can used for your purpose.
And validating Special characters you should well understand the WILDCARDS
For More information please read MSDN and your asp.net notes

If you have any confusion then asked
Best of luck


ASP.NET的验证类型有多种服务器控件 [^ ] .

MSDN链接列出了所有链接,还包含每个链接的详细信息和示例.

就您而言,您可能 RegularExpressionValidator [ ^ ]或您可以编写您的自定义验证.

要阅读有关验证控件的更多信息,请参见此处- ASP.NET验证控件 [ ^ ].

如果您需要更多选项和详细信息,也可以在Google上搜索"asp.net上的验证".

希望这会有所帮助!
There are various types of validation for ASP.NET server controls[^].

The MSDN link lists all of them and also contains detailed information and example for each of them.

In your case you will probably RegularExpressionValidator[^] or you may write your custom validation.

To read more about validation controls, see here - ASP.NET Validation Controls[^].

You may also search Google for "validation on asp.net" if you need more options and details.

Hope this helps!


这篇关于如何在asp.net中添加验证控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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