Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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
Edited 8-Jan-13 20:59pm
v3
Comments
GeekBond at 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
good
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[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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

Solution 3

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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 205
1 Sergey Alexandrovich Kryukov 185
2 jlopez788 144
3 Rob Philpott 100
4 Prakriti Goyal 97
0 OriginalGriff 6,837
1 Sergey Alexandrovich Kryukov 5,559
2 Maciej Los 3,479
3 Peter Leow 3,323
4 DamithSL 2,505


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 9 Jan 2013
Copyright © CodeProject, 1999-2014
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