javascript change lost on postback

G

Guest

Hello all,
I have a page that contains two listboxes and an "Add" button. When
clicked, the button fires javascript that moves the selected item(s) in the
first listbox to the second listbox and removes it from the first. This
works perfectly right now. The problem is that when I click the "Save"
button to save the values in the second listbox back to my DB, my C# doesn't
see anything in the second listbox and sees all the original values in the
first one.
I've already double checked to make sure that I'm not accidently overwriting
the values on postback.
Any ideas on why it won't remember the javascript change and/or how I can
get it to work?

Thanks!
 
D

dotnet dude

This is just a guess but I think the reason your application doesnot
find anything in the second listbox is because the javascript is not
updating the viewstate and the changes you make are lost during
postback when the Save button is clicked.
Solution: try using server SelectedItemChanged event on listbox
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,591
Members
45,103
Latest member
VinaykumarnNevatia
Top