I am looking for an event firing before a DropdownList auto-postback to save Listbox items (populated with JS) in the ViewState.
I tried the OnSelectedIndexChanged event but it’s fired too late.
Can this be done, and how?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This can’t be done, using ViewState. ViewState is set by the server. It can’t be modified by the client in JavaScript.
Suggest one of these options with JavaScript or jQuery:
You can then detect those changes after the page has posted back.
Set up your drop down to modify a hidden element.
Your DropDownList will post back as per normal.