can javascript do this

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

I have a .net page where I display a list of items and allow the user to
select one or more items and place the items in another text box as being
selected by clicking an arrow. I currently have two arrows, one to remove
the selected items from the source box and place them in the destination box
and another arrow to take the selected items from the destination box and put
them back in the source textbox. Just wondering if there is a way to do this
without posting back to the server? I
Thanks Paul.
 
Yes you can.

There are numerous examples out there. I think the AJAX controls on
www.asp.net have an example of doing exactly what you want. If not there, I
believe it is still somewhere on the ASP.NET site.

You can also use AJAX to avoid the appearance of post back on any pages you
want to seem more dynamic for the user.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
 
Yep trying to reduce the number of postbacks on the entire form. I
downloaded the ajax tool kit several months ago so will check it. I am not
sure how often they update the toolkit with new ajax controls but I may need
to grab the newest version.
thanks.
--
Paul G
Software engineer.


Gregory A. Beamer (Cowboy) - MVP said:
Yes you can.

There are numerous examples out there. I think the AJAX controls on
www.asp.net have an example of doing exactly what you want. If not there, I
believe it is still somewhere on the ASP.NET site.

You can also use AJAX to avoid the appearance of post back on any pages you
want to seem more dynamic for the user.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
 
If you have VS2008, just download SP1 for VS2008 and you have all but the
futures bits included.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
Paul said:
Yep trying to reduce the number of postbacks on the entire form. I
downloaded the ajax tool kit several months ago so will check it. I am
not
sure how often they update the toolkit with new ajax controls but I may
need
to grab the newest version.
thanks.
 
still have 2005, found a javascript function that seems to work well for
moving items back and forth between list boxes.
 
The cool thing about client side stuff, is you can always upgrade the
backend and still continue to use the client stuff. Glad you found something
that works.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
 
Yes there is a lot you can do with client side stuff as well. Still have one
issue, when moving items back to the original listbox it does not preserve
the original order as I need to keep the list in alphebetical order, thinking
may be able to call a javascript function to perform a sort on the items.--
Paul G
Software engineer.
 
I ended up using the following which uses the sort method, although probably
should pass in the name of the list box,
function sortlist() {
var lb = document.getElementById('ListBox1');
arrTexts = new Array();

for(i=0; i<lb.length; i++) {
arrTexts = lb.options.text;
}

arrTexts.sort();

for(i=0; i<lb.length; i++) {
lb.options.text = arrTexts;
lb.options.value = arrTexts;
}
}
 
Back
Top