D
David De Cotis
Hello all, I am trying to go through a ListBox and verify if am item was
selected. If an item was selected, I would like to get a handle of the item
and simply do a response.write on the selected handle. The issue that I am
facing is that I am going each item, but my code does not catch the selected
item. Can anyone please take a look at the code and let me know what I am
doing wrong.
If listBox1.Items.Count > 0 Then
For intCount = 0 To listBox1.Items.Count - 1
If listBox1.SelectedIndex = True Then
Response.Write(listBox1.SelectedIndex)
End If
Next
End If
B.T.W. this is the way the listBox is defined in the .NET HTML page:
<asp:listbox id="listBox1" runat="server" Width="200px"
Height="142px"></asp:listbox><BR>
selected. If an item was selected, I would like to get a handle of the item
and simply do a response.write on the selected handle. The issue that I am
facing is that I am going each item, but my code does not catch the selected
item. Can anyone please take a look at the code and let me know what I am
doing wrong.
If listBox1.Items.Count > 0 Then
For intCount = 0 To listBox1.Items.Count - 1
If listBox1.SelectedIndex = True Then
Response.Write(listBox1.SelectedIndex)
End If
Next
End If
B.T.W. this is the way the listBox is defined in the .NET HTML page:
<asp:listbox id="listBox1" runat="server" Width="200px"
Height="142px"></asp:listbox><BR>