开发者

asp.net ObjectDataSource return object from cache

开发者 https://www.devze.com 2023-02-04 10:38 出处:网络
Is there any way to return开发者_JAVA技巧 object from Session when Select is called on ObjectDataSource? Specifically, I have Products object and saved in Session. Now on another page I have ObjectDat

Is there any way to return开发者_JAVA技巧 object from Session when Select is called on ObjectDataSource? Specifically, I have Products object and saved in Session. Now on another page I have ObjectDataSource which will call same bussiness object method to get Products object. Here I want to hook up any event like Selecting and I would like to return Products object from Session to Select method of ObjectDataSource.

Is this possible?


You have to define the method as static and access the Session inside the method using HttpContext.Current.Session["products"].


ObjectDataSource has property EnableCaching property which can be set to true.Enable Caching

0

精彩评论

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

关注公众号