zoukankan      html  css  js  c++  java
  • 从ASP了解Http Buffer

    he Buffer property specifies whether to buffer the output or not. When the output is buffered, the server will hold back the response to the browser until all of the server scripts have been processed, or until the script calls the Flush or End method.

    Note: If this property is set, it should be before the <html> tag in the .asp file

    Syntax

    response.Buffer[=flag]
    ParameterDescription
    flag A boolean value that specifies whether to buffer the page output or not.

    False indicates no buffering. The server will send the output as it is processed. False is default for IIS version 4.0 (and earlier). Default for IIS version 5.0 (and later) is true.

    True indicates buffering. The server will not send output until all of the scripts on the page have been processed, or until the Flush or End method has been called.

    Examples

    Example 1

    In this example, there will be no output sent to the browser before the loop is finished. If buffer was set to False, then it would write a line to the browser every time it went through the loop.

    <%response.Buffer=true%>
    <html>
    <body>
    <%
    for i=1 to 100
      response.write(i & "<br>")
    next
    %>
    </body>
    </html>

    Example 2

    <%response.Buffer=true%>
    <html>
    <body>
    <p>I write some text, but I will control when
    the text will be sent to the browser.</p>
    <p>The text is not sent yet. I hold it back!</p>
    <p>OK, let it go!</p>
    <%response.Flush%>
    </body>
    </html>

    Example 3

    <%response.Buffer=true%>
    <html>
    <body>
    <p>This is some text I want to send to the user.</p>
    <p>No, I changed my mind. I want to clear the text.</p>
    <%response.Clear%>
    </body>
    </html>
  • 相关阅读:
    TCP IP基础知识的复习
    Design Pattern: Singleton 模式
    解决Win7下安装VS2010不显示序列号框的两种方法
    字典树(Trie tree)
    在VS如何查看汇编代码
    使用模板实现编译期间多态
    一段c++代码小例子
    C++ 虚函数表解析
    C++问题:if( input.rdstate() & std::ios::failbit )
    Design Pattern: Adapter 模式 Class Adapter
  • 原文地址:https://www.cnblogs.com/shineqiujuan/p/3593787.html
Copyright © 2011-2022 走看看