Points of Interest

Let me know if you have any queries.

History

New Article on AJAX to be added shortly.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

Comments and Discussions

Hi,
I added the following lines to my Page_Load in .cs file
btnMoveRight.Attributes.Add("onclick","return fnMoveItems('ListBox1','ListBox2')");
btnMoveLeft.Attributes.Add("onclick",return fnMoveItems('ListBox2','ListBox1')")

My VS 2013 has two wiggly lines under btnMoveRight and btnMoveLeft as "the doesn't exist in the current context." Would someone let me know what I need to add/remove to make Page_Load see these input objects?

Hello Partha.
I'm new to JavaScript and I tried to use this code for moving items between two asp:listboxes.
But the code execution doesn't pass the first line of code (var varFromBox = document.all(lstbxFrom);).
Intelisence doesn't recognize document.all. Do I need to have any specific add-on or something ?

to assist s to construct their gridview. It helps the user to manage GRID information such sct that related to gridview. It enables the user to construct and maintenance the gridview in interactive way. This document describes the User interface which helps the user to accomplish this goa

Parthas' function simply modifies the listboxes client-side(via javascript) and not server side (on the codebehind), in order for you to be able to update the listbox server side(codebehind) you'll need to write a method to handle that event (process/update the new listboxes created on client-side to the server side objects).

Else you can do everything server-side (codebehind), which would mean a postback per item(s) moved, something i personally dont like (Re-Render page contents etc etc with every click , easy to see why i dont like that, not to mention how slow interaction will be if the poor visitor/client sits behind a slow connection ), but you get people who would prefer to rather do it that way.

It is definitely possible, you will have to look for your client side changes in your Request object, probably Request.Form or something, and you'll find the changes in the form of an array if i remember correctly... (I can look into it if you dont come right)

You must remember, if your controls are located within a parent object (parent in parent in parent etc) That will affect your objects client side id (check the html) - which will be important to know when you retrieve the values from your request object.