Global variables on par with ASP's global.asa

Discussion in 'ASP .Net' started by Wayne, Nov 5, 2003.

  1. Wayne

    Wayne Guest

    I have googled etc for details on using global variables in the global.asax
    file in much the same manour as that in global.asa, and have come across
    some sites suggesting the use of:
    <object id='id' runat='server' classid='Namespace.Class'
    scope='Application'/>

    However, nothing happens, and when used in the context of the current
    application it just returns "Object not Defined".

    I have looked at the HttpApplicationState class, but the level of
    information returned by the object that I need global actually complicates
    the use if HAS.
    Wayne, Nov 5, 2003
    #1
    1. Advertising

  2. Wayne

    charles Guest

    Just say Application["myVariable"] = someObject. (and cast it to get it
    back).

    The <object... > mechanism you tried also uses the HttpApplicationState
    object but seems more complex

    charles


    "Wayne" <none@none> wrote in message
    news:%...
    > I have googled etc for details on using global variables in the

    global.asax
    > file in much the same manour as that in global.asa, and have come across
    > some sites suggesting the use of:
    > <object id='id' runat='server' classid='Namespace.Class'
    > scope='Application'/>
    >
    > However, nothing happens, and when used in the context of the current
    > application it just returns "Object not Defined".
    >
    > I have looked at the HttpApplicationState class, but the level of
    > information returned by the object that I need global actually complicates
    > the use if HAS.
    >
    >
    charles, Nov 5, 2003
    #2
    1. Advertising

  3. Wayne

    Wayne Guest

    "charles" <> wrote in message
    news:...
    > Just say Application["myVariable"] = someObject. (and cast it to get it
    > back).
    >
    > The <object... > mechanism you tried also uses the HttpApplicationState
    > object but seems more complex
    >
    > charles


    That is what I feared - but it does work very well; even to the point I can
    access that Object's members et-al.

    Thanks
    Wayne, Nov 11, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    378
  2. RooLoo
    Replies:
    14
    Views:
    263
    Julia Mark
    Nov 29, 2004
  3. PAR, PAR::Packer

    , Dec 1, 2006, in forum: Perl Misc
    Replies:
    1
    Views:
    211
    John Bokma
    Dec 1, 2006
  4. Replies:
    0
    Views:
    222
  5. Oliver Soeder
    Replies:
    1
    Views:
    240
Loading...

Share This Page