I am quite new to Web Development and ASP.net but i was wondering the following question:
If I declare a static variable on a web page and several users access the same page simultaneously. Is this static variable unique to each user or will it interfere with different users?
Thanks
Yes, it will interfere between users, and between concurrent requests by a single user. Avoid static fields in ASP.NET (and most other development) unless you are very sure about what you are doing.
Consider using session-state for what you are doing here, or something as part of the request itself (form data, cookie, etc).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With