Singleton-Pattern ASP.NET C#为每个用户 [英] Singleton-Pattern ASP.NET C# for each user
本文介绍了Singleton-Pattern ASP.NET C#为每个用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
Singleton不是答案。请参阅会话状态, ViewState 和 Cookies 。
i'm building a web application with asp.net c# and i have a class that i want to use in multiple pages witouth instantiate it every time. I need to load the data in it and never lose them during the user session time. I thought about the singleton-pattern but it shared the instance of the class beetween browsers. How can i solve the problem?
解决方案
Singleton is not the answer. Look at Session State, ViewState and Cookies.
这篇关于Singleton-Pattern ASP.NET C#为每个用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文