home *** CD-ROM | disk | FTP | other *** search
/ Chip 1999 September / CHIPCD_9_99.iso / software / uaktualnienia / OptionPackPL / iis4_07.cab / Application_JScript.asp < prev    next >
Text File  |  1998-04-27  |  2KB  |  61 lines

  1. <%@ LANGUAGE = JScript %>
  2.  
  3. <%
  4.     // Ensure that this page is not cached
  5.     Response.Expires = 0;
  6. %>
  7.  
  8.  
  9. <HTML>
  10.     <HEAD>
  11.         <TITLE>Using Application Variables</TITLE>
  12.     </HEAD>
  13.  
  14.     <BODY BGCOLOR="White" topmargin="10" leftmargin="10">
  15.  
  16.         <!-- Display Header -->
  17.  
  18.         <font size="4" face="Arial, Helvetica">
  19.         <b>Using Application Variables</b></font><br>
  20.       
  21.         <hr size="1" color="#000000">
  22.  
  23.  
  24.         <%
  25.             // If this is the first time any user has visited
  26.             // the page, initialize Application Value
  27.  
  28.             if (Application("AppPageCountJScript") == null) 
  29.             {
  30.                 Application("AppPageCountJScript") = 0;
  31.             }
  32.  
  33.  
  34.             // Increment the Application AppPageCount by one.
  35.             // Note that because this AppPageCount value is being
  36.             // shared, locking must be used to prevent 
  37.             // two sessions from simultaneously attempting 
  38.             // to update the value.
  39.  
  40.             Application.Lock();
  41.             Application("AppPageCountJScript") = Application("AppPageCountJScript") + 1;
  42.             Application.UnLock();
  43.         %>
  44.  
  45.  
  46.         <!-- Output the Application Page Counter Value -->
  47.         <!-- Note that locking does not need to be used -->
  48.         <!-- because the value is not being changed by -->
  49.         <!-- this user session -->
  50.  
  51.         Users have visited this page 
  52.         <%=Application("AppPageCountJScript")%> times!
  53.  
  54.  
  55.         <!-- Provide a link to revisit the page -->
  56.  
  57.         <p><A href = "Application_JScript.asp">Click here to visit it again</A>
  58.  
  59.     </BODY>
  60. </HTML>
  61.