设为首页 加入收藏 网站首页
休闲娱乐
军事·社会百态·娱乐八卦·校园
体育·美女写真·幽默笑话·游戏
综合·在线视频·搞笑图片·灵异
两性生活
两性知识·性爱技巧
情色实录·两性图片
女性健康·同性之恋
电脑网络
网络编程·网页制作·软件教学
操作系统·图形图象·冲浪宝典
网络安全·邮件系统·认证考试
热点专题
芙蓉·真人漫画
72式·欲望都市
帅哥·人体彩绘
您现在的位置: 世纪中国 >> 网络编程 >> ASP.NET教学 >> asp.net技巧 >> 教程正文
ASP.NET 2.0中的输出缓存
作者:中国图霸    教程来源:网络    点击数:    更新时间:2007-1-1

Just about every ASP.NET application needs to keep track of data for a user's session. ASP.NET provides the HttpSessionState class to store session-state values. An instance of the HttpSessionState class for each HTTP request is accessible throughout your application using the static HttpContext.Current.Session property. Access to the same instance is made simpler on every Page and UserControl using the Session property of the Page or UserControl.

The HttpSessionState class provides a collection of key/value pairs, where the keys are of type String and the values are of type Object. This means that Session is extremely flexible and you can store just about any type of data in Session.

But (there is always a but) this flexibility does not come without a cost. The cost is the ease with which bugs can be introduced into your application. Many of the bugs that can be introduced will not be found by unit testing, and probably not by any form of structured testing. These bugs often only surface when the application has been deployed to the production environment. When they do surface it is often very difficult, if not impossible, to determine how they occured and be able to reproduce the bug. This means they are very expensive to fix.

This article presents a strategy to help prevent this type of bug. It uses a Design Pattern called a Facade, in that it wraps the very free interface provided by the HttpSessionState class (that can meet the requirements of any application) with a well designed and controlled interface that is purpose built for a specific application. If you are not familiar with Design Patterns or the Facade pattern, a quick internet search of "facade design pattern" will provide you with plenty of background

[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页

分类推荐
社会 社会 娱乐 军事 校园
幽默 体育 女性 专题
电脑 编程 网页 软件 系统
安全 图象 冲浪 认证
搞笑 人物 动物 物品 表情
签名 色图 漫画 奇闻
美女 明星 清纯 自拍 欧美
丝袜 卡通 性感 走光
两性 知识 性图 孕育 技巧
同性 单身 情感 实录
视频 写真 搞笑 MTV 翻唱
写实 片段 游戏 综艺
asp.net技巧热门文章
普通教程 ASP.NET里常用的JS
普通教程 UpdatePanel与UrlRewrite
普通教程 .net内存回收与Dispose﹐Close
普通教程 用MasterPage 代替 PageBase
普通教程 DataSet 添加数据集、行、列、
普通教程 ASP.NET组件DataGrid的分页实用
普通教程 使用WebClient自动填写并提交A
普通教程 ASP.NET中水晶报表的使用
普通教程 对NDoc支持.net2.0的异常分析及
普通教程 关于ASP.NET调用javascrip
普通教程 MSBuild, NAnt, NUnit, MSTest
普通教程 asp.net 2.0 上传控件的使用
普通教程 UpdatePanel和自定义控件中的客
普通教程 ASP.NET—From验证:全部代码及
普通教程 自己写的一个asp.net的生成曲线
普通教程 js操作listbox
普通教程 ASP.NET 崩溃-SiteMap中疯狂的
普通教程 ASP.NET 2.0-选用DataSet或Da
普通教程 用.net 处理xmlHttp发送异步请
普通教程 ASP.Net 2.0 图形控件简述

  广东广州海珠区 世纪网络工作室 版权所有 上海电信提供网络带宽
信箱: 9297659@qq.com 粤ICP备06113754号