This problem can be solved by
session state means specific to ASP.NET,
https://msdn.microsoft.com/en-us/library/ms178581.aspx[
^].
But as JavaScript is mentioned in your tags, I would like to suggest a pure client-side approach, using
Web storage. This approach is more universal (as soon as JavaScript is not disabled in the browser :-)), because it does not depend on what you have on the server side or if you have server side at all.
Please see:
https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API[
^].
You can find a complete sample in this section my article:
JavaScript Calculator, 7. Dynamic Strict Mode Switching and Web Storage.
—SA