⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fragmentcache_bycontrol.ascx

📁 东软内部材料(四)asp等相关的教学案例 
💻 ASCX
字号:
<%@ Language="C#" %>
<%@ OutputCache Duration="60" VaryByControl="Category"%>

<Script runat=server>
  public void Button_Click(Object sender, EventArgs e){
    if (Category.Value == ""){
      Response.Cache.SetNoServerCaching();
      CategoryItem.InnerHtml = "Not cached...";
    }
    else
      CategoryItem.InnerHtml = "You selected: <font color=red>" + Category.Value + "</font>";
  }

  public void Page_Load(){
    // Get the Date and Time, once again this should not change after the first run       
    DateTime NowTime = DateTime.Now;
    DateTime Expires = NowTime.AddSeconds(60);

    CreatedStamp.InnerHtml = NowTime.ToString("r");
    ExpiresStamp.InnerHtml = Expires.ToString("r");
  }
</Script>
<form runat=server>
	<%=Request.QueryString["state"]%>
	<BR>
	Category:
	<select id="Category" size=1 runat=server>
		<option value="">
			<!--Select Category-->
		</option>
		<option>
			psychology
		</option>
		<option>
			business
		</option>
		<option value="Popular Computer">
			popular_comp
		</option>
	</select>
	<input type=submit value="Lookup" OnServerClick="Button_Click" runat=server>
</form>
<Font size=3><B id=CategoryItem runat=server></B>
	<P>
		Fragment Cache created: <Font color=red><B id=CreatedStamp runat=server></B></Font>
		<BR>
		Fragment Cache expires: <Font color=red><B id=ExpiresStamp runat=server></B></Font>
</Font>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -