Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

ASP Response Object

  • Last Updated : 29 Sep, 2021

The Response Object is used to send a response to the client request from a server. It has many predefined methods, properties, and collections.  

It has some methods, properties, and collections.  

Properties

  • Buffer: It defines that whether the out page would be buffered or not.
  • CacheControl: It is used to set whether a proxy server can cache the HTML Output or not.
  • Charset: It is used to append the name of the character set to the content-type header in the Response object.
  • ContentType: It is used to set the HTTP content type/subtype for the response header Object. The default value is text/HTML
  • Expires: It is used for setting the duration of time for the page will be expired before it catches on the browser.
  • ExpiresAbsolute: It is used for setting the date and time at which a page cached on a browser expires.
  • IsClientCertificate: It is used to specify whether the client is connected or disconnected from the server.
  • pics: It is used to appends a value to the PICS label response header.
  • status: It is used to specify the value of the status of the asp page which is returned by the user.

Methods  

  • AddHeader: This method s used to specify for adding a new name for the HTTP Header and provide and given a value to the HTTP Response.
  • AppendToLog: This Method is used for adding a string to the end of the server log entry for this request.
  • Clear: This Method is used to clear or erase a Buffered HTML Output.
  • End: This Method is used to ensure the webserver stops the processing of the scripts and returns the current result.
  • Flush: This Method is used to send buffered Output immediately.
  • Redirect: This Method is used to redirect the client to a different URL
  • Write: This method writes a specified string to the output.

 

Collections

  • cookies: It is used to set or get values of the cookies.

Example:  Below code illustrates the different methods of the Response Object.  

ASP




<%
    Response.Redirect "https://www.geeksforgeeks.org" 
    Response.AppendToLog "My log message"
    Response.Write("Hello GeeksforGeeks");
  
    Response.AddHeader "WARNING","Error"404 Not found"
  
%>

Output 

GeeksforGeeks
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!