开发者

MVC 2.0 c# asp.net 4.0 Instantiate an object from a library shared in the session

I'm trying to use the MVC 2.0 framework to instantiate an object of a library.

I want to be able to instantiate this object every time I navig开发者_JAVA技巧ate my application with a differnt browser (creating new session) and call methods on this object from my controllers mantaining separated the objects of different sessions.

Where do I have to store and instantiate my object?

Thanks


If the object's scope is session then I'd store it in the session cache.

You'll want to test in the controller's constructor if it exists, if not then create and store in the session.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜