RequiredFieldValidator : DropDownList (newbie qu)

  • Thread starter Thread starter Angela
  • Start date Start date
A

Angela

Hi

I am trying to validate a dropdown with RequiredFieldValidator.

One of the list items is 'Please select' with a value of 0.

How can I validate whether they have selected this option?

Thanks

Angela
 
You can use the InitialValue property to validate against this value.

<asp:req... InitialValue="0" /> will fail if "Please Select" is the
active.

Karl
 
Make it's value an empty string.

The REquiredFieldValidator will then work on it just like if it was any
other HTML control
 
Back
Top