Page Cache Substitution in ASP.NET
<strong><span style="color: #0000ff;"><%@ Page Language="VB" %>
<%@ OutputCache Duration="60" VaryByParam="none" %></span>
<span style="color: #3366ff;"><script runat="server">
Shared Function GetCurrentDate(ByVal context As HttpContext) As
String
Return Now.ToString()
End Function
</script></span>
<html>
<head id="Head1" runat="server">
<title>Post Cache Substitution</title>
</head>
<body>
<span style="color: #008000;"><form id="form1" runat="server"></span>
<h4>
This page uses post cache substitution to insert a dynamic
value into a cached page.</h4>
<p>
Time:
<span style="color: #0000ff;"><%= DateTime.Now.ToString() %></span>
</p>
<p>
<b>Real Time:
<span style="color: #008000;"><asp:Substitution ID="Substitution1" runat="server"
MethodName="GetCurrentDate" />
</b>
</p>
</form></span>
</body>
</html></strong>
You can
leave a response, or
trackback from your own site.
Leave a Reply
You must be logged in to post a comment.