Open In App

ASP Buffer Property

The Buffer Property in ASP is used for specifying whether the output will be buffered or not. When the page is buffering so that the server does not respond or send data to the client until the remaining server scripts have been successfully processed, or until the Flush or End method is called.

This Property can not break after when the server is started to send data to the server. The Buffer property should be set as the first line code of the .asp file. 



Syntax:

response.Buffer[=flag]

Parameter Values: This property accepts a single value as mentioned above and described below:



  1. true: It defines that page is Buffered.
  2. false: It specifies that the Output would not be buffered.

Note: If you set the response.Buffer=true on an infinite loop then the output will never sent to the client.

Example 1: In this Example, the Buffer Property is set to true so there is no output that will send to the browser. 




<!-- Buffer Property is set to true -->
<% response.Buffer=true %>
<html>
    <body>
          
<p>
            GeeksforGeeks is computer 
            science portal for Geeks.
        </p>
  
    </body>
</html>

Output: Here the flag value is set to true so the whole server scripts have been successfully compiled only then the output will be sent to the client.

GeeksforGeeks is computer science portal for Geeks.


Example 2:  Below example illustrates that the Buffer Property is set to False so the Output will be sent to the Browser. 




<!-- Buffer Property is set to true -->
<% response.Buffer=false %>
<html>
    <body>
          
<p>
            GeeksforGeeks is computer 
            science portal for Geeks.
        </p>
  
    </body>
</html>

 Output: Here the flag value is set to false so the output will not wait to get compiled whole server scripts, it will simply send the output to the client.

GeeksforGeeks is computer science portal for Geeks.

Article Tags :