What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 11298 |  Welcome, Guest!   Register  Login
 Home > Code Snippets > ASP.NET > How to use output caching in asp.net ...
Ranjeet_8

How to use output caching in asp.net

 Code Snippet posted by: Ranjeet_8 | Posted on: 9/1/2012 | Category: ASP.NET Codes | Views: 513 | Status: [Member] | Points: 40 | Alert Moderator   



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

Add This code on Page Load Event

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

Found interesting? Add this to:


>> Write Response - Respond to this post and get points

More codes snippets

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/24/2013 3:17:10 PM