In jquery how do you save variable which can only be true/false into a hidden field and retrieve a value after postback?
Share
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.
The jQuery part is nothing special, just put some textual representation of the value in the field, and later read it from the field:
However, the value in a hidden field doesn’t survive the postback by itself. You either have to turn the field into a server control using
runat="server", change it for a HiddenField control, or read the value from Request.Form or Request.QueryString and put the value in the field that is put in the new page.