i have 2 listbox(consider A and B) and move right, save buttons
-
using jquery i first move the data from A to B. this is the code i used for Move Right
$(function () { $('#addCat').click(function () { $(".ListBox1 > option:selected").appendTo(".ListBox2"); sortlist(".ListBox1 > option"); sortlist(".ListBox2 > option"); selectAll(); }); $('#removeCat').click(function () { $(".ListBox2 > option:selected").appendTo(".ListBox1"); sortlist(".ListBox1 > option"); sortlist(".ListBox2 > option"); selectAll(); }); $('#addCount').click(function () { $(".ListBox3 > option:selected").appendTo(".ListBox4"); sortlist(".ListBox3 > option"); sortlist(".ListBox4 > option"); selectAll(); }); $('#removeCount').click(function () { $(".ListBox4 > option:selected").appendTo(".ListBox3"); sortlist(".ListBox3 > option"); sortlist(".ListBox4 > option"); }); $('.submit').click(function () { //selectAll(); return newAccountValidate(); }); $('.save').click(function () { //selectAll(); return editAccountValidation(); }); }); -
then i click on Save buton, from code behind(server side) im trying to get the items from listbox B, there i dont get any items and items count is also 0.
i get that the listbox b items.count = 0
experts please tell me how to resolve this issue?
All of the changes made by JQuery won’t translate to the server; this means that you need to push the changes back to the server using JQuery $.ajax, or store the value in listbox2 in a hidden field, or something like that. With the second option (store in a hidden field), essentially what you are doing is tracking changes between what was in list 1 and 2…
That can be the problem of client-server interaction.