Need help with ListBox.SelectedIndexChanged

  • Thread starter Thread starter Keith Selbee
  • Start date Start date
K

Keith Selbee

I have a ListBox and a corresponding SelectedIndexChanged event and within
that event need to determine which item is selected, but it always comes
back as 0 (I'm not setting anything selected in my PageLoad). How can I get
the index of the item selected?

Keith
 
where is your code?

lstName.SelectedItem.Value can give you the answer.

before do so, you should verify that user selected one item.

if ( lstName.SelectedItem != null )
 
Seems to work, thanks.

Keith

Edward said:
where is your code?

lstName.SelectedItem.Value can give you the answer.

before do so, you should verify that user selected one item.

if ( lstName.SelectedItem != null )
 
Back
Top