asp.net public or global array

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!
 
J

John Saunders

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

Guest

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,227
Latest member
Daniella65

Latest Threads

Top