ListBox SelectedIndex is always -1

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
 
H

HB

Guys,

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

Thanks

HB
 
H

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top