Click here to Skip to main content
15,888,401 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi guy!

Today have make a mystic experience with my new first code asp.net

I use declare "public var" in my module and thats are viewed form ALL users like var application!!

Is right?
Why this?
Can I use application var only if I want do it and my public variable in my application only for the socket http of the user that run application split by user?

tks,
best regards
Posted
Updated 2-Oct-10 11:10am
v3
Comments
Sandeep Mewara 2-Oct-10 16:42pm    
Not clear. Whats 'var' here in your Q?
Giacomo Arbizzani 2-Oct-10 17:16pm    
var are my internal public var cross between sub.
Now I want delcare public's var between my sub but not across users!
I believed that every http request make a new istance of application and its internal procedures, vars, subs, etc.. but that is not !! Only one istance of application and all user can shared its module end var's value!
Is right?

1 solution

you are confusing application instance with session instance..
everytime a user accesses your web application, a new session is created for them, so all public variables in your module or class (whatever) are not shared with other users UNTIL you mark them as STATIC
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900