suff trek
suff trek

Reputation: 39767

VB.NET Shared properties in Classes in ASP.NET application

This might be a silly question, but if I create a class in ASP.NET/VB.NET application with a shared property (one accessible just by class name and not required class instantiation) and one user, currently logged in would set that property - would this shared value be accessible to another user of the same ASP.NET application using it at the same time, or would the value be confined for the user who set it?

Upvotes: 1

Views: 1312

Answers (2)

Kratz
Kratz

Reputation: 4330

Everyone. The class is loaded once by the server process and stays in memory to service all requests. So the shared property would show the same value for all page requests.

Had this problem with a website, the creator used a shared database object and users would end up getting each others search results.

Upvotes: 3

Alex S
Alex S

Reputation: 1221

Silly question since OOP does not have user concept :)

Silly answer: shared value will be accessible to another user of the same ASP.NET application using it at the same time.

Upvotes: 0

Related Questions