选择验证控件需要帮助(我希望得到帮助) [英] Help needed for choosing validation controls (I would like to be helped)

查看:70
本文介绍了选择验证控件需要帮助(我希望得到帮助)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是ASP.Net的新手。试图为航空公司售票系统建立一个项目。因为我有很多问题,我需要很多帮助。



我想打扰一个对你来说可能很简单的问题,但对我而言,这意味着很多。



问题1: 。首先,我在一些领域做了注册表。



某些字段需要大整数等数字作为输入。哪种验证方法更适合在那里使用?

RequiredFieldValidator RegularExpressionValidator



此外,我不理解 RegularExpressionValidator的任务



编辑:格式和标题。旧标题:我希望得到帮助。

I am new to ASP.Net. Trying to build a project for Airline ticketing system. I need a lot of help as I have many questions.

I would like to bother you with a problem that may be simple for you, But for me, it means a lot.

question 1:. First, I made a registration form with some fields.

some fields require numbers such as big integer as input. Which validation method will be better to use there?
RequiredFieldValidator or RegularExpressionValidator?

Moreover, I do not understanding the task of RegularExpressionValidator

formatting and title. Old title: I would like to be helped.

推荐答案

RequiredFieldValidator 用于验证必填字段。因此,对于所有强制性字段,您必须放置 RequiredFieldValidator



RegualrExpressionValidator 用于检查输入。您可以使用正则表达式仅接受有效输入,并避免检查输入服务器端。对于需要某些特定类型输入的所有控件,例如仅限数字或字母数字,您将不得不使用它。



现在,如果任何控制是强制性的并且需要特定输入类型你必须使用两者。详情请参阅:



了解ASP.NET验证技术 [ ^ ]
RequiredFieldValidator is to validate the mandatory fields. So for all the fields that are mandatory you will have to put a RequiredFieldValidator.

RegualrExpressionValidator is for checking the input. you can use regular expression to accept only valid inputs and save yourself from checking the inputs serverside. For all the controls that need some specific type of input like number only or alphanumeric only you will have to use this.

Now if any control is mandatory and need specific input type you will have to use both. Refer this for details:

Understanding ASP.NET Validation Techniques[^]


使用comparevalidator进行整数检查,并将requiredfieldvalidator用于必填字段
use comparevalidator for integer check and use requiredfieldvalidator for mandatory field






请检查以下链接这可能对您有所帮助





ASP.NET中的验尸控件 [ ^ ]



< a href =http://www.codeproject.com/Articles/7943/Validator-Controls-in-ASP-NET> ASP.NET中的验证器控件 [ ^ ]



探索ASP.NET验证控件 [ ^ ]





http:/ /msdn.microsoft.com/en-us/library/debza5t0(v=vs.100).aspx [ ^ ]



u检查此链接这可能是帮助你。



在问一次问题之前,请与你一起查看谷歌。
Hi,

Please check the below links this might be help for you


Validator Controls in ASP.NET[^]

Validator Controls in ASP.NET[^]

Exploring ASP.NET Validation Controls[^]


http://msdn.microsoft.com/en-us/library/debza5t0(v=vs.100).aspx[^]

u check this links this might be help for you .

Before ask the question once please check with google from your side.


这篇关于选择验证控件需要帮助(我希望得到帮助)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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