<%@ Page Language="vb" %> <%@ OutputCache Duration="300" VaryByParam="None" %> <html> <head> <title>Adding a cache dependency in ASP.NET</title> <script runat="server"> Sub Page_Load() Response.AddCacheItemDependencies("Key1") myMessage.Text = DateTime.Now() End Sub Sub Button1_Click(sender As Object, e As EventArgs) Cache("Key1") = "foo" End Sub </script> </head> <body> <form runat="server"> <asp:label id="myMessage" runat="server"/> <asp:button id="Button1" text="Change Key 1" onClick="Button1_Click" runat="server"/> </form> </body> </html>