home *** CD-ROM | disk | FTP | other *** search
/ PC World 2003 September / PCWorld_2003-09_cd.bin / Software / Vyzkuste / webmatrix / WebMatrix.msi / Data1.cab / _66D5EE08C020489CBDC9CE97C7B7D394 < prev    next >
Encoding:
ASP.NET Web Form  |  2003-04-28  |  1.6 KB  |  43 lines

  1. <%@ Page language="C#"%%ClassName, ClassName="{0}"%% %>
  2. <%@ OutputCache Duration="100" VaryByParam="Category"%>
  3. <script runat="server">
  4.  
  5.     void Page_Load(Object sender, EventArgs e) {
  6.  
  7.         TimestampCreated.Text = DateTime.Now.ToString("r");
  8.         TimestampExpires.Text = DateTime.Now.AddSeconds(10).ToString("r");
  9.     }
  10.  
  11.     void Button1_Click(Object sender, EventArgs e) {
  12.  
  13.         CategoryItem.Text = "You selected: " + Category.SelectedItem.Text;
  14.     }
  15.  
  16. </script>
  17.  
  18. <html>
  19.     <body style="font-family:arial">
  20.         <form runat="server">
  21.             <h2>
  22.                 Vary Cache By Parameters
  23.             </h2>
  24.             <asp:Label id="CategoryItem" runat="server"></asp:Label>
  25.             <hr size="1">
  26.             Category:
  27.             <asp:DropDownList id="Category" runat="server">
  28.                 <asp:ListItem value="default">-- Select Category --</asp:ListItem>
  29.                 <asp:ListItem>psychology</asp:ListItem>
  30.                 <asp:ListItem>business</asp:ListItem>
  31.                 <asp:ListItem value="Popular Computer">popular_comp</asp:ListItem>
  32.             </asp:DropDownList>
  33.             <asp:Button ID="Button1" Text="Lookup" OnClick="Button1_Click" runat="server"></asp:Button>
  34.             <p>
  35.                 Output Cache created:
  36.                 <asp:Label id="TimestampCreated" ForeColor="red" Font-Bold="true" runat="server"></asp:Label>
  37.                 <br>
  38.                 Output Cache expires:
  39.                 <asp:Label id="TimestampExpires" ForeColor="red" Font-Bold="true" runat="server"></asp:Label>
  40.             </p>
  41.         </form>
  42.     </body>
  43. </html>