help in declaring variables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hello in vb.net i would use shared to share a variable in the same class..
but how can i do this in c#? thanks.
 
static is equivalent to shared, not sure if you are using it appropriately,
but should work the same...

Karl
 
Asha said:
hello in vb.net i would use shared to share a variable in the same class..
but how can i do this in c#? thanks.

Please be more specific about what you want to do. You probably do NOT want
to use a static (Shared) variable in an ASP.NET application. Such a variable
can be accessed by multiple requests for the same page at the same time. If
the variable is modified by the page, you will have a race condition.

John Saunders
 
Back
Top