If you need to save Javascript state through postback, then it is best to serialize your data and save it in a hidden form field with each change, and then reload this field during page reload. However, I would recommend, if possible, replacing callbacks with AJAX calls to prevent them in the first place.
source
share