Dharmesh Sharma

Dharmesh Sharma

  • NA
  • 905
  • 928.5k

how to set index of dropdownlist

Jan 12 2012 5:08 AM
hello,

 in my webpage i boud dropdowdlist by sqldatasource.
now i wan to set the selected item 3 of this dropdwonlist

for example:dropdownlist bound with sqldatasource and dropdownllist has a,b,c,d

now i want to search the item in dropdownlist b then select b on page load

how i do that my code not working

i use this code on page load

dropdownlist.SelectedIndex=convert.toint32(dropdownlost.items.findbytext("b").text);

not working


Answers (13)