asp.net public or global array

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
msand said:
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.
 
that's just what I needed - thank you!

John Saunders said:
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.
 
Back
Top