How to use output caching in

Posted by Ranjeet_8 under ASP.NET category on | Points: 40 | Views : 1581

<%@ OutputCache Duration="120" VaryByParam="None" %>
<html xmlns="">
<head id="Head1" runat="server">
<title>Testing Page</title>
<form id="form1" runat="server">
<asp:Label ID="Label1" runat="server" Font-Size="Larger" ForeColor="Green" Text="Output Caching Duration Is 120 seconds.">
<br /><br />
<asp:Label ID="Label2" runat="server" Font-Size="Larger" ForeColor="Red" >
<br />Press F5 to Refresh the page (Time will change after 120 sec)

Add This code on Page Load Event

Label2.Text = "Present Time: ";
Label2.Text += DateTime.Now.ToString();

Comments or Responses

Login to post response