javascript - Remove item from ASP listbox in client side script -


i using javascript code delete selected item in listbox named lbresources when user clicks button:

var listresources = document.getelementbyid('lbresources'); listresources.options.remove(listresources.selectedindex); 

this removes item listbox, on postback server, item still exists in code behind. there way code behind list box object reflect item remove on client side? time should use standard html listbox instead of asp .net control?

i can use hidden field hold data need pass postback, i'd avoid if possible.

the asp.net control keeps rendering in same way each time postback or page load. doesn't care did on client side. it's interested in values of controls. validates against viewstate. can not that.

i'd recommend using hidden field pass items want remove , updatepanel prevent page loaded.

or can use standard html input depends on whether need know other selected values on server side.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -