I've just spend a lot of time solving the following problem:
I used dotNet 2.0 / Visualstudio 2005 / C# / aspx, enable viewstate is
set on all controls.
I have 2 listboxes; the left contains items that can be (dynamically)
added to the right box.
Adding the first item went fine, it shows up in the right box.
Adding the second item resulted in losing _every_ control following the
right box. 'View source' reveiled that the rendering of the page stoped
at the <select of the second item in the box.
The box also showed only the last added item and a 'blank' entry.
Adding a third item resulted in an error message 'XML Parsing Error: no
element found' (at least in FireFox, IE just showed a blank page :( )
The solution:
(RE)SET THE SELECTEDINDEX OF THE LISTBOX AFTER AN ITEM IS ADDED!
Why? beats me. I suspect that because of the lame state/event handling
structure in a webpage there are somehow TWO selected indexes available
for ONE listbox...