home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_06.cab / samp01gn.asp < prev    next >
Text File  |  1997-10-15  |  3KB  |  38 lines

  1.  <% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/sdk/samp01gn.asp&srcfile=Interaction/Buffer" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  3. <HTML>
  4. <HEAD>
  5. <META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
  6. <title>Response Buffering</title>
  7. <script language="JavaScript">
  8.  
  9.     szNavVersion = navigator.appVersion
  10.  
  11.     if (navigator.appName == "Microsoft Internet Explorer") {
  12.     if (szNavVersion.indexOf ("4.") >= 0) {
  13.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  14.     } else {
  15.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  16.     }
  17.     }
  18.     else if (navigator.appName == "Netscape") {
  19.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  20.     }
  21.     else {
  22.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  23.     }
  24.  
  25. </script>
  26. <META NAME="DESCRIPTION" CONTENT="Internet Information Server reference information"></HEAD>
  27. <BODY BGCOLOR=#FFFFFF TEXT=#000000>
  28. <font face="Verdana, Arial, Helvetica">
  29. <h3><a name="_response_buffering"></a>Response Buffering</h3>
  30. <p>
  31. This example demonstrates how you can manipulate the output buffer of the <b>Response</b> object using ASP. Unbuffered output written to the <b>Response</b> object is sent to the client browser as quickly as possible. If buffering is enabled, all output is allowed to accumulate in the buffer until it is either cleared or flushed (with the <b>Clear</b> and <b>Flush </b>methods respectively) or the script ends. </p>
  32. <p>
  33. This sample script contains all the HTML elements required for two complete Web pages. If this script were run without any buffer management, both HTML pages would be sent to the client browser, causing an error. But for this sample, buffering is enabled at the very beginning of the script with the <b>Response.Buffer</b> property. ASP writes the first group of HTML elements it finds to the buffer, but then encounters the <b>Response.Clear </b>method, which instructs ASP to clear the <b>Response</b> object's buffer. The scripting engine continues through the file, writing the remaining, second, HTML page to the buffer. The entire buffer is then sent to the client browser with the <b>Response.Flush</b> method. </p>
  34. <hr class="iis" size="1">
  35. <p align="center"><em><a href="/iishelp/common/colegal.htm">© 1997 by Microsoft Corporation. All rights reserved.</a></em></p>
  36. </BODY>
  37. </HTML>
  38.