dropdownlist FindByText

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey all,
drp1.SelectedValue = drp1.Items.FindByText(lblEdit.Text)

how would i make the above work. it says:

Cannot implicitly convert type 'System.Web.UI.WebControls.ListItem' to
'string'

thanks,
rodchar
 
drp1.SelectedValue = drp1.Items.FindByText(lblEdit.Text)

drp1.Items.FindByText(lblEdit.Text).Selected = True

Not particularly robust, though, as this will throw an exception if the item
in question can't be found...
 
thanks for the help.
rod.

Mark Rae said:
drp1.Items.FindByText(lblEdit.Text).Selected = True

Not particularly robust, though, as this will throw an exception if the item
in question can't be found...
 
Back
Top