请问思归一个关于HttpContext.Current.Items和Cache的问题。
HttpContext.Current.Items和HttpContext.Current.Cache的区别是什么?
哪里有这两个东东的具体用法吗?
问题点数:100、回复次数:3Top
1 楼saucer(思归)回复于 2003-05-04 11:44:44 得分 50
HttpContext.Current.Items is only good for the current request, HttpContext.Current.Cache is good as long as the cache is not expired
HttpContext.Current.Items["hello"] = object;
see how to use HttpContext.Current.Cache here:
http://www.fawcette.com/Archives/premier/mgznarch/vbpj/2001/11nov01/an0111/an0111-1.aspTop
2 楼webdiyer(.net资源精华—www.dotneturls.com)回复于 2003-05-04 12:13:58 得分 50
HttpContext.Current.Items是针对当前Http请求的,即可以在一个http请求中共享数据,典型的用法是在一个aspx页中获得数据,然后保存在Context.Items中与当前http请求的页共享,象用户控件等。一个最好的例子是IBuyspy portal,你可以看看它的源码。而Cache中保存的数据可以在整修应用程序中使用。
--------------------------------
AspNetPager 免费分页控件2.0版发布,新增Url分布功能,欢迎下载使用:http://www.webdiyer.com
Top




