I'm trying to wrap my head around this, but I just can't.
Let's say I have a class called custom. I have a variable in it called User_ID, which I use to retrieve a user's session (so I don't have to keep calling the session variable over and over again). Something like this:
Public Class custom
Public Shared User_ID as integer
Public Shared sub GatherUserID()
User_ID = Session ("user_ID")
end sub
end class
Yes, it's a very simple example, but it gets my point across. I've done things similar to this in classic ASP (using includes, not classes) and the User_ID would be unique to whomever was accessing the page in question at that time.
For some reason, and this is what I don't understand, when I use custom.User_ID in a custom class, it's shared for everyone. That's what I don't want. What I want is to be able to use a variable like that and keep it user-specific. I see the advantage to sharing variables across classes (e.g. database connection strings), but I don't see how to set up a custom variable in a custom class that I can use just for that user without having to constantly call Sessions.
I see that I can declare it as a Property as opposed to a shared variable, but I really don't know what exactly that is intended to accomplish, and no one seems to have a clear explanation. Is a Property user/session-specific? Will it solve my specific problem as a result? This is what I don't get.
EDIT: just to clarify, the user_ID in this example is something I intend to use in several spots that get called during the creation of a page (e.g. the master file, the page itself, various classes.) Hence the reason for the creation of a custom variable.
Thanks.