G
Geoff Pennington
I have a page with two WebControls.ListBox controls. The first listbox is
for unassigned staff, the second is for assigned staff. I use client-side
JavaScript to let the user move items back and forth between the two lists.
The client side code works fine.
When the user submits the form I want to update the database from the
current contents of the "Assigned" list. Problem is, my server side code
only "sees" the original content of the datalists. For example, if there are
four names in each list and I move one from "Unassigned" to "Assigned", the
server side code thinks there are still four items in each list. (I checked
that using the debugger.) When the browser window redisplays, the lists
appear as they did before the client side re-arranging. This is with
ViewState enabled; if I disable ViewState the lists come up blank.
Is there a way to make the server code see the results of the client side
activity? The best I've come up with is to let the client side code maintain
a list in a
hidden field of who is in which listbox, and letting the server code use
that list, but that seems kludgy. I'm wondering if, since the ListBox
contents can't be directly edited, there simply is no way to post "current
contents" back to the server.
Much obliged.
for unassigned staff, the second is for assigned staff. I use client-side
JavaScript to let the user move items back and forth between the two lists.
The client side code works fine.
When the user submits the form I want to update the database from the
current contents of the "Assigned" list. Problem is, my server side code
only "sees" the original content of the datalists. For example, if there are
four names in each list and I move one from "Unassigned" to "Assigned", the
server side code thinks there are still four items in each list. (I checked
that using the debugger.) When the browser window redisplays, the lists
appear as they did before the client side re-arranging. This is with
ViewState enabled; if I disable ViewState the lists come up blank.
Is there a way to make the server code see the results of the client side
activity? The best I've come up with is to let the client side code maintain
a list in a
hidden field of who is in which listbox, and letting the server code use
that list, but that seems kludgy. I'm wondering if, since the ListBox
contents can't be directly edited, there simply is no way to post "current
contents" back to the server.
Much obliged.