All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
asp.net2.0指定和禁用主题
Visual,Studio,2008,Service,Pack,1,-,BETA,发布_[Asp.Net教程]
ASP.NET,2.0中客户端脚本总结_[Asp.Net教程]
用PHP操作MySql数据库(分页)_[PHP教程]
.net获取w3wp进程对应的应用程序池_[Asp.Net教程]
扩展ASP.NET,2.0内置GridView控件之一_.net资料_编程技术
如何在PHP中进行身份认证_[PHP教程]
无废话C#设计模式之六:Builder_.net资料_编程技术
asp.net2.0网站语法之Web.config文件配置
SQL,Server常见连接错误_[SQL,Server教程]
Reading number is top 10 pictures
深圳的风光
29 the belle stars after bath figure5
A resort photographed beautiful young woman change clothes process vomiting blood1
Black and white also sexy--YanLiu2
西游四格漫画(四)
住院一星期,检测费两万
India's national beauty of the college students
Beautiful vacuum girl2
From China fortress sora aoi4
Sora aoi mirror memorial classics4
Download software ranking
Eclipse 4.2.2 For Win32
网络管理员第三版
WebService在.NET中的实战应用教学视频 → 第5集
C++教程第四版
Desire a peach blossom
打鸟视频
WebService在.NET中的实战应用教学视频 → 第4集
Detective task-the top secret prostitution files
Tram sex maniac 2 (H) rar bag2
c#程序设计案例教程
delv published in(发表于) 2014/1/10 6:25:04 Edit(编辑)
ASP.NET2.0缓存(Cache)技术_[Asp.Net教程]

ASP.NET2.0缓存(Cache)技术_[Asp.Net教程]

ASP.NET2.0缓存(Cache)技术_[Asp.Net教程]


ASP.NET 2.0提供了一些新的用于提升程序性能的技术特性,其中,缓存技术是非常重要的一个特性,它提供了一种非常好的本地数据缓存机制,可以非常容易的定制属于数据缓从,从而有效的提高数据访问的性能。

经试验,觉得自定义控件中加入缓存,从而实现整个页的局部缓存,效果不错。

自定义控件在前台加入:

<%@ OutputCache Duration="60" VaryByParam="none" %>

后台代码:

protected void Page_Load(object sender, EventArgs e)
...{
Label1.Text = DateTime.Now.ToString();

source = (DataView)Cache["SQUARE"];

if (source == null)
...{
conn = new SqlConnection(ConfigurationManager.ConnectionStrings["GoConnectionString"].ConnectionString);
mycmd = new SqlDataAdapter("select * from GUser", conn);

DataSet ds = new DataSet();

mycmd.Fill(ds, "GUser");

source = new DataView(ds.Tables["GUser"]);

Cache["SQUARE"] = source;

}
else
...{

}

GridView1.DataSource = source;
GridView1.DataBind();
}
来源:CSDN





添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.