Listbox set to single not working

T

tshad

I have the following listbox:

<asp:ListBox ID="Positions" SelectionMode="single" Rows="8" Width="600"
runat="server"/>

I also have the following traces:

trace.warn("Positions.SelectedValue = " & Positions.SelectedValue)
trace.warn("Positions.SelectedIndex = " & Positions.SelectedIndex)

I am getting

Positions.SelectedValue = 0.001767 0.001342
Positions.SelectedIndex = -1 0.001798 0.000030


If I select an item and want to send the value to a stored procedure, I am
finding the selection getting unselected, and therefore I get an error.
When it posts back it shows it unselected.

If I set the SelectionMode to "Multiple", it works fine. It will grab the
lowest selectedItem and use that. When it posts back whatever was selected
is still selected. Why is the "Single" mode not working?

Thanks,

Tom
 

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

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,144
Latest member
KetoBaseReviews
Top