Open In App

ASP Buffer Property

Improve
Improve
Like Article
Like
Save
Share
Report

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.

  • Flush Method: This is used to send Buffered HTML Output immediately. 
  • End Method: This is used to stop the working process of scripts. It usually returns the current results.   

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:

  • flag:  It contains the Boolean value which specified that whether the Output should be buffered or not.
  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. 

HTML




<!-- 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. 

HTML




<!-- 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.


Last Updated : 24 Jul, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads