asp.net public or global array

Discussion in 'ASP .Net' started by =?Utf-8?B?bXNhbmQ=?=, Jul 21, 2004.

  1. I'm populating a listbox from an array of strings. I have to do this on several pages. How and where can I declare the array where I can use it from all the pages, without having to create the array on each page.

    Thank you!
     
    =?Utf-8?B?bXNhbmQ=?=, Jul 21, 2004
    #1
    1. Advertising

  2. "msand" <> wrote in message
    news:...
    > I'm populating a listbox from an array of strings. I have to do this on

    several pages. How and where can I declare the array where I can use it
    from all the pages, without having to create the array on each page.

    You can store the array in Session state if it varies per-user, or in
    Application state, if it is the same for all users. You can then retrieve
    the array on any page you need it on.
    --
    John Saunders
    johnwsaundersiii at hotmail
     
    John Saunders, Jul 21, 2004
    #2
    1. Advertising

  3. that's just what I needed - thank you!

    "John Saunders" wrote:

    > "msand" <> wrote in message
    > news:...
    > > I'm populating a listbox from an array of strings. I have to do this on

    > several pages. How and where can I declare the array where I can use it
    > from all the pages, without having to create the array on each page.
    >
    > You can store the array in Session state if it varies per-user, or in
    > Application state, if it is the same for all users. You can then retrieve
    > the array on any page you need it on.
    > --
    > John Saunders
    > johnwsaundersiii at hotmail
    >
    >
    >
     
    =?Utf-8?B?bWFyaW9u?=, Jul 21, 2004
    #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,420
    smith
    Dec 8, 2004
  2. SpamProof
    Replies:
    0
    Views:
    618
    SpamProof
    Oct 21, 2003
  3. Kevin Spencer
    Replies:
    2
    Views:
    3,331
    Kevin Spencer
    Sep 15, 2004
  4. Steve Mauldin
    Replies:
    5
    Views:
    1,742
    Steve Mauldin
    Jan 26, 2006
  5. DaveLessnau
    Replies:
    3
    Views:
    443
    Howard
    May 16, 2005
Loading...

Share This Page