home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / Cancel_JScript.asp < prev    next >
Text File  |  1997-10-25  |  1KB  |  60 lines

  1. <%@ Language=JScript     %>
  2.  
  3. <HTML>
  4.     <HEAD>
  5.         <TITLE>Client Connection</TITLE>
  6.     </HEAD>
  7.  
  8.     <BODY bgcolor="white" topmargin="10" leftmargin="10">
  9.         
  10.         <!-- Display Header -->
  11.  
  12.         <font size="4" face="Arial, Helvetica">
  13.         <b>Client Connection</b></font><br>   
  14.  
  15.         <p>About to perform a compute intensive operation... <br>
  16.  
  17.         <%
  18.             var x, i;
  19.             x = 1;
  20.         
  21.         
  22.             // Perform a long operation.....
  23.  
  24.             for(i = 0; i < 1000; i++)
  25.             {
  26.                 x = x + 5;
  27.             }                
  28.  
  29.  
  30.             // Check to see if the client is still
  31.             // connected before doing anything more
  32.  
  33.             if (Response.IsClientConnected())
  34.             { 
  35.                 // Ouput Status
  36.                 Response.Write("User still connected<br>");
  37.  
  38.  
  39.                 // Perform another long operation
  40.  
  41.                 for (i = 1; i < 1000; i++)
  42.                 {
  43.                     x = x + 5;
  44.                 }                
  45.             }
  46.  
  47.             
  48.             // If the user is still connected, send back
  49.             // a closing message
  50.             
  51.             if (Response.IsClientConnected())
  52.             { 
  53.                 Response.Write("<p>Finished<br>");
  54.                 Response.Write("Thank you for staying around!  :-)");
  55.             }
  56.         %>
  57.  
  58.     </BODY>
  59. </HTML>
  60.