Which Validation Control Should I use to select at least one value in Dropdown List control

Questions by marisarla

Showing Answers 1 - 11 of 11 Answers

Karthikeyan

  • Jul 21st, 2006
 

Use Custom Validator by specifying

if (DropDownList1.SelectedIndex>-1)

{

}

  Was this answer useful?  Yes

ghanshyam

  • Sep 8th, 2006
 

use requiredfieldvalidator and set the initial value property of validator to the zero'th value of the dropdownlist if which zero'th item contains "---select---"

  Was this answer useful?  Yes

Rupesh Tiwary

  • Dec 23rd, 2006
 

RequiredField validation control is one best option for it..

  Was this answer useful?  Yes

samiksc

  • Jul 17th, 2007
 

Use RequiredFieldValidator control. Set its 'InitialValue' property to something like 'Select an item'.
This control will ensure that the user has to change the value from InitialValue to another value.
If InitialValue is not set the dropdown list will be initially empty. It is not mandatory to set InitialValue property

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions