Question about Validation controls

G

Guest

Hi,

I have a Web Form which has 2 text boxes: txtStartNo and txtEndNo. I ant to
make sure:
(1) Both txtStartNo and txtEndNo are entered by users
(2) Both values entered are integers and greater than 0
(3) The value of txtEndNo must be greater than txtStartNo

If I want to use validation controls come with ASP.Net, how many controls
and what kind of controls should I use?

TIA
 
A

A Traveler

I think you would need five.

1 RequiredFieldValidator for each text box.
1 RegularExpressionValidator for each to make sure that it is the integer >
0.
1 ComparisonValidator to make sure that the comparison is done as you wish.

HTH.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top