Variable Scope and IIS

T

TSW

I am a fairly new programmer who is seeking some insight
into variable scope and IIS.

I have recently completed development on an ASP.Net
application (VB.Net). In order to make certain variables
available to all my subroutines I defined them as
follows: Shared VariableName

While this met my immediate need, it appears to be
causing problems when several users are accessing my
application concurrently. User A is getting variable
information from User B, etc.

I was under the impression that IIS created a unique
instance of my application for each user and that all
variable information would be available only to that
specific user. It appears that my assumption was
incorrect.

My question is as follows: How can I dimension variables
that are available to all of the sub routines contained
in my class file, but at the same time limit the scope to
the user that initiated the application?

Any assistance would be greatly appreciated.

Regards,
TSW
 
K

Kevin Spencer

There is only ONE application. All code runs in that context.
My question is as follows: How can I dimension variables
that are available to all of the sub routines contained
in my class file, but at the same time limit the scope to
the user that initiated the application?

Session will store them in a Collection that is available to all pages of a
single User. ViewState will store data in a serializable Collection that
exists for the life of a single Page of a single User.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

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,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top