温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:VS2005典型实例源码大全(C#)
当前文件:
VS2005Helper/Web/Cahce/PageByControl.aspx,打开代码结构图
VS2005Helper/Web/Cahce/PageByControl.aspx,打开代码结构图1<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="PageByControl.aspx.cs" 2
Inherits="Cahce_PageByControl" Title="页面输出缓存(VaryByControl)" %> 3
4
<%@ Register Src="CacheControl.ascx" TagName="CacheControl" TagPrefix="uc1" %> 5
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> 6
<p> 7
未经缓存设置的容器页: 8
<%=DateTime.Now %> 9
</p> 10
<p> 11
经过VaryByControl设置的用户控件,根据DropDownList的不同缓存不同的内容(用户控件中的@OutputCache指令为Duration="10" 12
VaryByControl="DropDownList1"):<br /> 13
<uc1:CacheControl ID="CacheControl1" runat="server" /> 14
</p> 15
</asp:Content> 16



Inherits
