help in declaring variables

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.
 
K

Karl Seguin

static is equivalent to shared, not sure if you are using it appropriately,
but should work the same...

Karl
 
J

John Saunders

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
 

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,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top