数据库缓存
时间:2021-07-01 10:21:17
帮助过:5人阅读
服务器端
2 protected void Page_Load(
object sender, EventArgs e)
3 {
4 BLL.UserInfoService UserInfoService =
new BLL.UserInfoService();
5 UserInfo userInfo= UserInfoService.GetModel(
int.Parse(Request.QueryString[
"Id"]));
6 List<UserInfo> list =
new List<UserInfo>
();
7 list.Add(userInfo);
8 this.DetailsView1.DataSource =
list;
9 this.DetailsView1.DataBind();
10 }
11
12 客户端
13
14 <%@ Page Language=
"C#" AutoEventWireup=
"true" CodeBehind=
"ShowDetailCache.aspx.cs" Inherits=
"CZBK.TestProject.WebApp._2014_11_17.ShowDetailCache" %>
15
16 <%@ OutputCache Duration=
"5" VaryByParam=
"*" %>
页面缓存 如果是none的话,则id 都是1
17 <!DOCTYPE html>
18
19 <html xmlns=
"http://www.w3.org/1999/xhtml">
20 <head runat=
"server">
21 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8"/>
22 <title></title>
23 </head>
24 <body>
25 <form id=
"form1" runat=
"server">
26 <div>
27 <asp:DetailsView ID=
"DetailsView1" runat=
"server" Height=
"105px" Width=
"506px"></asp:DetailsView>
28 </div>
29 </form>
30 </body>
31 </html>
四 数据源缓存 (了解)
五 文件缓存依赖(了解)
微软AJAX(了解)(ToolKit)
数据库缓存
标签:char get content info 共享 parse div asp svi