ListBox SelectedIndex is always -1

  • Thread starter Thread starter S. Justin Gengo
  • Start date Start date
S

S. Justin Gengo

HB,

You're probably databinding the list box on every page load which is
resetting it before you can get the selected value.

Put:

If Not IsPostBack Then
'---Datbind list box here
End If

Into your code and you'll get the selected value.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
Guys,

PLS tell my why the ListBox SelectedIndex is always -1?, I am sure selection
was made.

Thanks

HB
 
Many Thanks

S. Justin Gengo said:
HB,

You're probably databinding the list box on every page load which is
resetting it before you can get the selected value.

Put:

If Not IsPostBack Then
'---Datbind list box here
End If

Into your code and you'll get the selected value.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
Back
Top