ASP.NET表单验证 [英] ASP.NET Form Validations

查看:73
本文介绍了ASP.NET表单验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我要验证我的表单,该表单包含电子邮件,用户名,密码和DOB
我想使用asp.net内置的验证器,请为我建议这些字段的验证器

Hello,
I want to validate my form, the form contains email, username, password and DOB
i want to use asp.net''s built in validators, please suggest me validators for these fields

推荐答案

此链接将为您提供帮助
http://www.worldofasp.net/tut/tutorialsharp1/How_to_use_validation_controls_in_ASPNET_434.aspx [ ^ ]

http://www.dotnetfunda.com/articles/article785- how-to-use-validation-controls-in-aspnet.aspx [
this links will help you
http://www.worldofasp.net/tut/tutorialsharp1/How_to_use_validation_controls_in_ASPNET_434.aspx[^]

http://www.dotnetfunda.com/articles/article785-how-to-use-validation-controls-in-aspnet.aspx[^]


^ ]

用户名-> RequiredFieldValidator以确保输入名称.
密码(和确认密码)-> CompareValidator检查它们是否匹配,RegularExpressionValidator实施密码策略.
DOB-> CustomValidator.
电子邮件-> RegularExpressionValidator.
Validation Server Controls
[^]

Username --> RequiredFieldValidator to ensure name is entered.
Password (and Confirm Password) --> CompareValidator to check if they match, RegularExpressionValidator to enforce password policy.
DOB --> CustomValidator.
Email --> RegularExpressionValidator.


这篇关于ASP.NET表单验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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