Results 1 to 4 of 4

Thread: Passing global variables from one ASP to another ASP

  1. #1

    Thread Starter
    Hyperactive Member vbuser1976's Avatar
    Join Date
    Sep 2000
    Location
    Yonkers, NY
    Posts
    404

    Passing global variables from one ASP to another ASP

    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.
    -vbuser1976
    VB6 Enterprise SP6
    SQL 7.0 SP2
    VBScript, HTML, Javascript, C++, a little UNIX

  2. #2
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Sudbury, Ontario, Canada
    Posts
    274
    You can use a session variable.
    Code:
    session("myvariable") = 10
    To reference it use:
    Code:
    newvariable = session("myvariable")

  3. #3
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    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)
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  4. #4

    Thread Starter
    Hyperactive Member vbuser1976's Avatar
    Join Date
    Sep 2000
    Location
    Yonkers, NY
    Posts
    404

    Talking Thanks!

    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!
    -vbuser1976
    VB6 Enterprise SP6
    SQL 7.0 SP2
    VBScript, HTML, Javascript, C++, a little UNIX

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width