Click here to Skip to main content
12,955,118 members (69,147 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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

EDIT: formatting and title. Old title: I would like to be helped.
Posted 8-Jan-13 20:35pm
Updated 8-Jan-13 20:59pm
GeekBond 9-Jan-13 2:48am
'I would like to be helped' is not a good title, use the 'Improve question' widget (the little green button) below your question to update the title.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

use comparevalidator for integer check and use requiredfieldvalidator for mandatory field
Rate this: bad
Please Sign up or sign in to vote.

Solution 3


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[^][^]

u check this links this might be help for you .

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,559
CHill60 3,550
Maciej Los 3,153
ppolymorphe 2,030
Jochen Arndt 1,975

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 9 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100