62,046
社区成员
发帖
与我相关
我的任务
分享
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="P_Cache.aspx.cs"Inherits="Chapter14_P_Cache" %>
//这个是缓存的时间 单位是秒 这个是 是否受参数影响
<%@ OutputCache Duration="30" VaryByParam="none" %>
//动态加载缓存控件
PartialCachingControl pcc = (PartialCachingControl)this.LoadControl ("UC_Cache_Code.ascx");
//设置失效时间
pcc.CachePolicy.SetExpires(DateTime.Now.AddSeconds(30));
this.Controls.Add(pcc);