Set VaryByParam (VB.net) : OutputCache « Development « ASP.NET Tutorial






<%@ Page Language="VB" %>
<%@ OutputCache Duration="60" VaryByParam="none" %>

<script runat="server">
   sub Page_Load(Sender as Object, e as EventArgs)
      Response.Cache.VaryByParams.Item("first") = true
      Response.Cache.VaryByParams.Item("last") = false

      lblMessage.Text = "Welcome " & Request.Params("first") & _
         "! The time is now " & DateTime.Now.ToString("T")

      lblMessage.Text += "<br>" & Response.Cache. _
         VaryByParams.Item("first").ToString

      lblMessage.Text += "<br>" & Response.Cache. _
         VaryByParams.Item("last").ToString
   end sub   
</script>

<html><body>
   <form runat="server">
      <asp:Label id="lblMessage" runat="server"/>
   </form>
</body></html>








9.36.OutputCache
9.36.1.Using the Output Cache (C#)
9.36.2.OutputCache Duration="30" VaryByParam=true (C#)
9.36.3.Set VaryByParam (VB.net)