Access to public variables defined in Global.asax.vb

Discussion in 'ASP .Net' started by =?Utf-8?B?dnZlbms=?=, Oct 7, 2005.

  1. Hello:

    I have defined public variables in Global.asax.vb that are initialized in
    the application_start event.

    How do I reference these variables in other ASP forms? For example, if my
    variable is goTest, I thought I can reference it as Global.goTest but I see
    that I cannot.

    Thanks.

    venki
    =?Utf-8?B?dnZlbms=?=, Oct 7, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?dnZlbms=?=

    Lucas Tam Guest

    "=?Utf-8?B?dnZlbms=?=" <> wrote in
    news::

    > I have defined public variables in Global.asax.vb that are initialized
    > in the application_start event.
    >
    > How do I reference these variables in other ASP forms? For example, if
    > my variable is goTest, I thought I can reference it as Global.goTest
    > but I see that I cannot.


    Assign them as application variables ... rather than local public
    variables.

    --
    Lucas Tam ()
    Please delete "REMOVE" from the e-mail address when replying.

    Newmarket Volvo Sucks! http://newmarketvolvo.tripod.com
    Lucas Tam, Oct 7, 2005
    #2
    1. Advertising

  3. =?Utf-8?B?dnZlbms=?=

    John Smith Guest

    The variable must be a "public shared" one.

    "vvenk" <> schreef in bericht
    news:...
    > Hello:
    >
    > I have defined public variables in Global.asax.vb that are initialized in
    > the application_start event.
    >
    > How do I reference these variables in other ASP forms? For example, if my
    > variable is goTest, I thought I can reference it as Global.goTest but I
    > see
    > that I cannot.
    >
    > Thanks.
    >
    > venki
    John Smith, Oct 10, 2005
    #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. Charles A. Lackman
    Replies:
    1
    Views:
    1,340
    smith
    Dec 8, 2004
  2. SpamProof
    Replies:
    0
    Views:
    544
    SpamProof
    Oct 21, 2003
  3. Ekul
    Replies:
    2
    Views:
    649
  4. =?Utf-8?B?YmNoYXJsZXM=?=

    global.asax and global.asax.cs

    =?Utf-8?B?YmNoYXJsZXM=?=, Oct 4, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    820
    =?Utf-8?B?YmNoYXJsZXM=?=
    Oct 5, 2004
  5. Mark Rae

    Global.asax / Global.asax.cs in v2

    Mark Rae, May 23, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    3,151
    Mark Rae
    May 23, 2006
Loading...

Share This Page