Response object: Output returned to the client
(1), Method:
Response.Write (): Output information to client
Response. Redirect (): redirect
Response . Clear (): clears all HTML pages in the buffer
Response . End (): terminates processing of the ASP and returns to the current state
Response.Flush (): immediately send out the buffer's HTML data
Response. WriteFile () reads a file and writes to the client output stream (in essence: Opens the file and outputs it to the client. )
(2), properties
Response.ContentType The content type of the output stream, such as html (text/html) , normal text (Text/pain), or JPEG picture (image /jpeg).
encoding of the response.contentencoding output stream
Response.Cookies: A collection of Cookies returned to the browser
Response. Buffer : set buffering information, true | false. The default is true
Response. Expires: Gets or sets the number of minutes before the page that is cached on the browser expires, set to 0, expires immediately,
Type of property value : System.Int32
The number of minutes before the page expires.
Response.ExpiresAbsolute : Gets or sets the absolute date and time to remove cache information from the cache
Property value: System.DateTime ; the date and time when the page expires.
Response.CacheControl : The HTTP header, whose value is the cacheability enumeration.
Among them: CacheControl , expiresabsolute , Expires , have been discarded, in order to be compatible with the old version, so write .
Now control the cache using Response 's Cache property:
Response.Cache : Gets the Web page's Caching policy ( for example, expiration time, privacy settings, and change terms )
Response.Cache.SetExpires(): Set cache expiration date
Response.Cache.SetNoStore():// Sets the Cache-control:no-store HTTP header. and Response.CacheControl = "No-cache"; function as well. /
Requst object: Reads the request message data from the browser.
Post mode data: requst.form[""]
URL data: requst.querystring[]
Both post and URL can be obtained using request["" "
The code to disable caching on the ASP. NET Server is as follows:
///caching is disabled on the server side, so server-side caching fails, and every time you need to load code from the server sideResponse.Buffer =true; Response.ExpiresAbsolute= DateTime.Now.AddDays (-1);///to be compatible with older versionsResponse.Cache.SetExpires (DateTime.Now.AddDays (-1)); Response.Expires=0;///to be compatible with older versions///Response.CacheControl ="No-cache";///to be compatible with older versionsResponse.Cache.SetNoStore ();///sets the Cache-control:no-store HTTP header.
The client disables the cache code as follows:
<http-equiv= "Pragma" content= "No-cache"/> < http-equiv= "Cache-control" content= "No-cache, must-revalidate" /><http-equiv= "Expires" content = "0" />
Partial methods and properties of an ASP. Response object