Link to home
Start Free TrialLog in
Avatar of pharosinnyc
pharosinnyc

asked on

postback does not preserve state of listbox that has been changed using javascript

I have an aspx page with few web server ListBox, one of the listBox is empty. I have client side java script that populate the empty ListBox on a button click. Everything works fine.

Now when I do a postback via a LinkButton, I lose the data populated via the javascript. Anythoughts why this is happening and what should I do?
ASKER CERTIFIED SOLUTION
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pharosinnyc
pharosinnyc

ASKER

oh.. I suspected this.. exactly what I didnt want to hear.lol

Does this mean to take full advantage of postback we shouldnt use client side javascript? I am just starting to use .net

Avatar of Bob Learned
Yeah, or if you are working client-side, then stay client-side, since you can't mix the two without a bridge in between (hidden form field).

Bob
k. Thanks Bob/Tim