Looking at the problem statement it looks like you need some variables to behave as if they are static from your applications perspective. Changing the variables to session variables will let you reuse the variable from same session. If you need to make the variable value available from all your application then you will need to use Application object./code>object.
Application["key"] = value;
here is a small link to understand the logic behind doing this.
A Beginner's Tutorial on ASP.NET State Management[
^]
Let me know if I understood it incorrectly and I will try to refine my answer.