CustomValidator does not fire

G

Guest

Hi,
I have two pairs of a DropDownList and TextBox Controls and for each pair I
have a CustomValidator that makes sure that at least one of the two
(DropDownList or TextList) has a value.
When I submit the form, the OnServerValidate method for the first pair of
controls (DropDownList and TextList) fires, but for the second pair does not.
It make no sense, both pairs look exactly the same to me.
The only difference is that the second DropDownList gets populated based on
the selection in the first DropDownList .

Any ideas?
Thanks.
 
K

Kumar Reddi

One thing you should always remember with customValidator
is, for it to work, the control against which it is used,
should have a value. If there is no value, customValidator
wouldnt fire. So, its always a good idea to use
RequiredFieldValidator along with CustomValidator, to make
sure you catch the required field error

HTH
Kumar
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top