How can I clear the value of an asp:HiddenField control when the user hits the refresh button in the browser?
How can I clear the value of an asp:HiddenField control when the user hits
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.
In the load event (
Page_Load,OnLoad) sethiddenVariableControl.Value = String.Empty.If you are capturing this hidden variable’s value for another event, you could do the following in the load event:
This sets the value of the hidden variable to a blank string on refreshes, but postbacks (like a button event) would keep the value.