Hello all!
I've 2 asp listbox controls and an html input button, and using js i add items (previously loaded from DB) from listbox A to B and it works fine, but when i submit the form, in the code behind the listbox B do not have the item i added accessible.
My idea was trying to save roundtrips to the server and make it in client side but looks like it doesn't work.
Any ideas?
Thanks you very much for you time!
EDIT
There's the code
<asp:ListBox ID="lstBoxOrgs" runat="server" Height="117px" Width="502px" SelectionMode="Multiple"></asp:ListBox>
<input type="button" value="Add" onclick="AddItems2Listbox('lstBoxOrgs', 'lstBoxUserRelOrgs') "/>
Code behind:
protected void AssignOrgs_Click(object sender, EventArgs e)
{
foreach (ListItem orgItem in lstBoxUserRelOrgs.Items)
{
//Update database here...
}
//Commit updates to DB
cdc.SubmitChanges();
}
The onclick="AddItems2Listbox('lstBoxOrgs', 'lstBoxUserRelOrgs')
is the javascript function that adds the items from lisbox A to listbox B.
Thanks