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. Advertisements

  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. Advertisements

  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. Advertisements

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:
    3
    Views:
    4,265
    Steve Sobol
    Jan 16, 2005
  2. Replies:
    0
    Views:
    547
  3. yuridia

    Problem loading ASP and global.asa in IIS 5.0

    yuridia, Oct 13, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    172
    yuridia
    Oct 13, 2004
  4. RooLoo
    Replies:
    14
    Views:
    426
    Julia Mark
    Nov 29, 2004
  5. Rahul
    Replies:
    7
    Views:
    234
    Anthony Jones
    May 11, 2006
  6. PAR, PAR::Packer

    , Dec 1, 2006, in forum: Perl Misc
    Replies:
    1
    Views:
    416
    John Bokma
    Dec 1, 2006
  7. Replies:
    0
    Views:
    413
  8. Oliver Soeder
    Replies:
    1
    Views:
    494
Loading...