I have a listbox control that is in multiple selection mode.
<asp:listbox id="listMultiChapter" name="listMultiChapter" runat="server" selectionmode="Multiple" width="250px"></asp:listbox>
I am looping through this listbox to grab all selections and then store them.
For Each li As ListItem In listMultiChapter.Items
If li.Selected Then
If strMultiChapter = "" Then
strMultiChapter = li.Text
strMultiChapter = strMultiChapter & "|" & li.Text
This code had been working fine until recently. At SOME point, this code no longer works but only when I initially save a record. I use this SAME CODE when updating a record and it works fine. My testing has determined the following:
1) The code is showing NO selections - I have tested to make sure no li.selected come back as true.
2) The code after is working fine - I set the strMultiChapter after this code snippit and it gets inserted into the record correctly.
3) I fill the listbox slightly differently when it comes back to an edit (I pass in an id which removes certain items from the box depending on selection). However, I have manually removed this from the update routine and it still saves on edit and does not on insert.
Has anyone had any experience with .net controls not initializing correctly? I do use the AJAX toolkit. I recently 'skinned' the HTMLEditor on this form but I also removed that skin as well to see if that was affecting this - still no solution.
Any input greatly appreciated! Thanks!