I'm moving itmes from one ASP.NET ListBox control to another ListBox control from client-side. It works on the client-side but when I tried to count items in destination ListBox on the server-side, it's always nothing. Below, is the jQuery code used to add/remove items from ListBox control.
<script type="text/javascript">
$(document).ready(function(addToList) {
// to move selected item from lbSource to lbDestination
$("#add").click(function() {
$("#lbSource option:selected").appendTo("#lbDestination").attr("selected", false);
});
// to remove selected item from lbDestination to lbSource
$("#remove").click(function() {
$("#lbDestinaion option:selected").appendTo("#lbSource").attr("selected", false);
});
});
</script>
I know that we can add/remove items from ListBox from server-side. But I'd like to get it done from client-side.
Why there isn't anything in the destination ListBox when counting the items from the code-behind, eventhough the items are added from the client-side already.