Is it possible to create a global variable? If so, how do I pass the variable from one page to another without adding it in the Request.Querystring? I hope this does not sound confusing. Thanks in advance.
Printable View
Is it possible to create a global variable? If so, how do I pass the variable from one page to another without adding it in the Request.Querystring? I hope this does not sound confusing. Thanks in advance.
You can use a session variable.
To reference it use:Code:session("myvariable") = 10
Code:newvariable = session("myvariable")
If by global variable, you mean one that is alive across all sessions, use an application variable and initialize it in your global.asa file. If you just mean a variable that is unique to each session but available on all pages during that session, then use a session variable. But be sparing on their use. They prevent a web app from scaling beyond one server. If this isn't a concern, then go nuts :c)
Thank you both for your input. Since my web app will not be scaling beyong one server, and since I am only need one global variable for each unique session, then I am using the session variable.
Thanks Again!