Click here to Skip to main content
15,902,299 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
hII ,

i have a class variable which sends email to users based on companyId,

Suppose if i store compayId in static variable will be differnt per session wise when that class methods will be invoked

I am very much confused when to use static variable as some says this stores same value throughout the istance of the calss , some says that value store in this will be same for all sessions ...
Posted
Updated 21-May-14 22:54pm
v2

Yes, static values will remain same for all users. if one user is updating that value, then it will be reflected to other users as well.

You can use querystring or any other state management to pass values from one form to other
 
Share this answer
 
Comments
Torakami 22-May-14 6:17am    
Thanks
Hi,
the static varibale will be shared beetween all the sessions! So in your case you can't save the id in the static variable.
 
Share this answer
 
Comments
Torakami 22-May-14 6:17am    
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900