I have a listbox containing multiple items that is being populated on page load. Each item in the listbox can be selected without a problem except for the last item. When that one is clicked on the selection automatically jumps up to two items above. I can't seem to wrap my head around why this is happening. It only occurs when the last item is selected. The listbox is in an update panel within an ajax tab container, but I can't see why that would make a difference. I really hope I'm not missing something obvious...
Listbox:
<asp:ListBox ID="availableServicesListBox"
runat="server"
class="formListBox"
AutoPostBack="True"
onselectedindexchanged="availableServicesListBox_SelectedIndexChanged">
</asp:ListBox>
Page Load Event:
if (!Page.IsPostBack)
{
//populate from database
}
selectedIndex changed event (for autopostback):
protected void availableServicesListBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (availableServicesListBox.SelectedValue.Length > 10)
{
servicePanel.Visible = true;
activePanel.Visible = true;
}
else
{
servicePanel.Visible = false;
}
}