Shared Keywork in an ASP .Net Web Application

R

RSH

Is a "Shared" access modifier in a class Shared across all instantiations in
all sessions, or just the instantiations of the class in the current
session?

If Shared is across all instantiations of a class in all Sessions, what is
the access modifier eqivilent I should be using to "Share" only in the
current session?

Thanks!
Ron

public class test
private shared m_allApproved as boolean

Public Shared Property AllApproved()
Get

Return m_AllApproved

End Get

Set(ByVal Value)

m_AllApproved = Value

End Set

End Property

end class
 
J

John Saunders [MVP]

RSH said:
Is a "Shared" access modifier in a class Shared across all instantiations
in all sessions, or just the instantiations of the class in the current
session?

If Shared is across all instantiations of a class in all Sessions, what is
the access modifier eqivilent I should be using to "Share" only in the
current session?

Shared (static in C#) is shared across all sessions. There is no keyword to
share only within a single session.

In order to do that, you need to use "session variables", which aren't
really variables. See the article "Session State Overview", at
http://msdn2.microsoft.com/en-us/library/ms178581.aspx.
 

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,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top