System.Web 1.0.5000.0 2.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.Object

The methods and properties of the class are exposed through the property of the , , , and classes.

The following methods of the class are supported only in postback scenarios and not in asynchronous postback scenarios:

Partial-page updates are enabled when you use controls to update selected regions of a page instead of updating the whole page with a postback. For more information, see UpdatePanel Control Overview and Partial-Page Rendering Overview.

Encapsulates HTTP-response information from an ASP.NET operation.

- Constructor

  This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

  The methods and properties of the class are exposed through the intrinsic object in ASP.NET.

  Initializes a new instance of the class.

  A object that enables custom HTTP output.
  1.0.5000.0
  2.0.0.0
- Method
  2.0.0.0
  System.Void ``

  The method allows dependencies to be created between cached responses and a object.

  Associates a set of cache dependencies with the response to facilitate invalidation of the response if it is stored in the output cache and the specified dependencies change.

  A file, cache key, or to add to the list of application dependencies.
- Method
  System.Void ``

  When the items referred to in the parameter are removed from the cache, the cached response of the current item is not valid.

  Makes the validity of a cached response dependent on other items in the cache.

  The that contains the keys of the items that the current cached response is dependent upon. 1.0.5000.0 2.0.0.0
- Method
  2.0.0.0
  System.Void ``

  When any of the s are removed from the cache, the cached response of the current item is invalid.

  Makes the validity of a cached item dependent on another item in the cache.

  An array of item keys that the cached response is dependent upon.
- Method
  System.Void ``

  When the item corresponding to the parameter is removed from the cache, the cached response of the current item is invalid.

  Makes the validity of a cached response dependent on another item in the cache.

  The key of the item that the cached response is dependent upon. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` To be added

  Adds a group of file names to the collection of file names on which the current response is dependent.

  The collection of files to add. 1.0.5000.0 2.0.0.0
- Method
  2.0.0.0
  System.Void `` To be added.

  Adds an array of file names to the collection of file names on which the current response is dependent.

  An array of files to add.
- Method
  System.Void ``

  When you use the method to add a file dependency, you must also specify output caching programmatically or declaratively. For example, to specify output caching declaratively, use the @ OutputCache directive. For more information, see How to: Cache Page Output with File Dependencies.

  Adds a single file name to the collection of file names on which the current response is dependent.

  The name of the file to add. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` ``

  is the same as and is provided only for compatibility with earlier versions of ASP. With ASP.NET, use .

  Adds an HTTP header to the output stream. is provided for compatibility with earlier versions of ASP.

  The name of the HTTP header to add to. The string to add to the header. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` This is equivalent to: Response.Cookies.Add (cookie).

  Adds an HTTP cookie to the intrinsic cookie collection.

  The to add to the output stream. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` ``

  If you use the method to send cache-specific headers and at the same time use the cache object model () to set cache policy, HTTP response headers that pertain to caching (Cache-Control, Expires, Last-Modified, Pragma, and Vary) might be deleted when the cache object model is used. This behavior enables ASP.NET to maintain the most restrictive settings. For example, consider a page that includes user controls. If those controls have conflicting cache policies, the most restrictive cache policy will be used. If one user control sets the header "Cache-Control: Public" and another user control sets the more restrictive header "Cache-Control: Private" via calls to , then the "Cache-Control: Private" header will be sent with the response.

  For a list of standard HTTP/1.1 headers, see section 14, "Header Field Definitions," in the Hypertext Transfer Protocol -- HTTP/1.1 specification on the World Wide Web Consortium (W3C) Web site.

  Adds an HTTP header to the output stream.

  The name of the HTTP header to add to the output stream. The string to append to the header. 1.0.5000.0 2.0.0.0
- Method
  System.Void ``

  To allow for the specified string to be recorded in the log file, you first must enable the URI Query option of the Extended Logging Properties dialog box for the site that you want to log activity for in IIS.

  To customize extended logging in IIS 6.0, follow these steps:

  In IIS Manager, expand the local computer node, expand the Web or FTP Sites folder, right-click the Web or FTP site, and then click Properties.

  Click the Web or FTP Site tab, and then select the Enable logging check box (if it is not already selected).

  In the Active log format box, click W3C Extended Log File Format.

  Click Properties.

  Click the Advanced tab, select the properties that you want to log, and then click OK.

  Adds custom log information to the Internet Information Services (IIS) log file.

  The text to add to the log file. 1.0.5000.0 2.0.0.0
- Method
  System.String ``

  is used only with cookieless sessions to construct absolute HREFs.

  Adds a session ID to the virtual path if the session is using session state and returns the combined path. If session state is not used, returns the original virtual path.

  The with the session ID inserted.

  The virtual path to a resource. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` The contents of this buffer are sent back to the client without being altered by the current encoding of the response.

  Writes a string of binary characters to the HTTP output stream.

  The bytes to write to the output stream. 1.0.5000.0 2.0.0.0
- Property
  System.Boolean The current state of buffering.

  The property has been deprecated in favor of the property and is provided only for compatibility with earlier versions of ASP. With ASP.NET, use .

  Gets or sets a value indicating whether to buffer output and send it after the complete response is finished processing.

  1.0.5000.0
  2.0.0.0
- Property
  System.Boolean Whether output is currently being buffered. This controls whether HttpResponse should buffer the output before it is delivered to a client. The default is .

  The buffering can be changed during the execution back and forth if needed.

  This property is the same as

  Gets or sets a value indicating whether to buffer output and send it after the complete page is finished processing.

  1.0.5000.0
  2.0.0.0
- Property
  System.Web.HttpCachePolicy To be added: an object of type 'HttpCachePolicy' To be added

  Gets the caching policy (such as expiration time, privacy settings, and vary clauses) of a Web page.

  1.0.5000.0
  2.0.0.0
- Property
  System.String To be added: an object of type 'string'

  The values for Private, Public, and No-Cache are strings and must be enclosed in quotation marks (" "). If the property is set to a value that does not match one of the enumeration values, then an is thrown. If the property is not set, the cacheability of the response is set to .

  The CacheControl, , and properties have been deprecated. Instead, the methods of the class are available through the intrinsic object to control the Internet Information Services (IIS) output cache and client caches.

  Gets or sets the Cache-Control HTTP header that matches one of the enumeration values.

  1.0.5000.0
  2.0.0.0
- Property
  System.String The current character set.

  The Charset property can be set to null to suppress the HTTP Content-Type header.

  Gets or sets the HTTP character set of the output stream.

  1.0.5000.0
  2.0.0.0
- Method
  System.Void

  The method does not clear header information.

  Clears all content output from the buffer stream.

  1.0.5000.0
  2.0.0.0
- Method
  System.Void

  The method does not clear header information.

  Clears all content output from the buffer stream.

  1.0.5000.0
  2.0.0.0
- Method
  System.Void This clears all the header definitions that might have been added with .

  This throws an if the headers have already been sent to the client (for example, if the user has called the method.

  Clears all headers from the buffer stream.

  1.0.5000.0
  2.0.0.0
- Method
  System.Void

  This method terminates the connection to the client in an abrupt manner and is not intended for normal HTTP request processing. The method sends a reset packet to the client, which can cause response data that is buffered on the server, the client, or somewhere in between to be dropped.

  You might use this method in response to an attack by a malicious HTTP client. However, typically you should call instead if you want to jump ahead to the event and send a response to the client.

  Closes the socket connection to a client.

  1.0.5000.0
  2.0.0.0
- Property
  System.Text.Encoding a

  Default ContentEncoding can be specified in an ASP.NET configuration file in the globalization Element (ASP.NET Settings Schema) section. If is specified by the client, the default configuration settings are overridden.

  Gets or sets the HTTP character set of the output stream.

  1.0.5000.0
  2.0.0.0
- Property
  System.String The current Content-Type value. The default value is text/html.

  Gets or sets the HTTP MIME type of the output stream.

  1.0.5000.0
  2.0.0.0
- Property
  System.Web.HttpCookieCollection A collection with all the cookies being sent back to the client.

  ASP.NET includes two intrinsic cookie collections. The collection accessed through the collection of contains cookies transmitted by the client to the server in the Cookie header. The collection accessed through the collection of contains new cookies created on the server and transmitted to the client in the Set-Cookie header.

  After you add a cookie by using the collection, the cookie is immediately available in the collection, even if the response has not been sent to the client.

  Gets the response cookie collection.

  1.0.5000.0
  2.0.0.0
- Method
  System.Void

  This method is provided only for compatibility with ASP—that is, for compatibility with COM-based Web-programming technology that preceded ASP.NET. If you want to jump ahead to the event and send a response to the client, it is usually preferable to call instead.

  To mimic the behavior of the End method in ASP, this method tries to raise a exception. If this attempt is successful, the calling thread will be aborted, which is detrimental to your site's performance. In that case, no code after the call to the method is executed.

  If the method is not able to raise a , it instead flushes the response bytes to the client. It does this synchronously, which can also be detrimental to your site's performance.

  In either case (whether or not a exception is successfully raised), the response pipeline jumps ahead to the event.

  The method does not raise an exception, and code after the call to the method might be executed. If your intention is to avoid execution of subsequent code, and if the performance penalty of is acceptable, you can call instead of .

  Sends all currently buffered output to the client, stops execution of the page, and raises the event.

  1.0.5000.0
  2.0.0.0
- Property
  System.Int32 To be added: an object of type 'int'

  The Expires, and properties have been deprecated in favor of the methods of the class available through the intrinsic object to control the Internet Information Services (IIS) output cache and client caches.

  Gets or sets the number of minutes before a page cached on a browser expires. If the user returns to the same page before it expires, the cached version is displayed. is provided for compatibility with earlier versions of ASP.

  1.0.5000.0
  2.0.0.0
- Property
  System.DateTime To be added: an object of type 'DateTime'

  The ExpiresAbsolute, , and properties have been deprecated in favor of the methods of the class available through the intrinsic object to control the Internet Information Services (IIS) output cache and client caches.

  Gets or sets the absolute date and time at which to remove cached information from the cache. is provided for compatibility with earlier versions of ASP.

  1.0.5000.0
  2.0.0.0
- Property
  System.IO.Stream a

  When you create a Stream object and set the property to the Stream object, all HTTP output sent by passes through the filter.

  Gets or sets a wrapping filter object that is used to modify the HTTP entity body before transmission.

  1.0.5000.0
  2.0.0.0
- Method
  System.Void

  Forces all currently buffered output to be sent to the client. The method can be called multiple times during request processing.

  Sends all currently buffered output to the client.

  1.0.5000.0
  2.0.0.0
- Property
  2.0.0.0
  System.Text.Encoding To be added.

  The property gives you the ability to disable or change the object on a response header by using the , , , or object. The default encoding value is the class.

  By changing the type of the property, you can potentially increase the risk of certain malicious attacks or cause sensitive data to be sent through the response header. Header injection attacks can be avoided, in part, by leaving the property of a response to the default setting. An attack against a vulnerable application could echo back entrusted data as part of a response header. If the is disabled because of a requirement for continuation lines in a header or if any header is constructed based on the result of untrusted data, the header data should be validated before sending to the response stream.

  Gets or sets an object that represents the encoding for the current header output stream.

- Property
  System.Boolean if the client is still connected, otherwise.

  The property returns false when the following conditions are true:

  The connection to the client was terminated. This can occur if the method was invoked, or if the client stopped execution of the Web page or browsed to another page.

  The object that is handling the request is null or the method returns false. If a custom object handles the request, then the method might be set based on custom criteria. For example, the custom worker request might force a time-out after a period of time.

  Gets a value indicating whether the client is still connected to the server.

  1.0.5000.0
  2.0.0.0
- Property
  2.0.0.0
  System.Boolean To be added.

  Use the property with the property to test and determine whether the absolute URI that is transmitted to the client in the HTTP Location header is different than the current URI and what the new intended URI that is being transferred to will be.

  Gets a Boolean value indicating whether the client is being transferred to a new location.

- Property
  System.IO.TextWriter The textwriter. The text writer uses the encoding specified in the . This writer is TextWriter wrapper on top of the stream.

  Enables output of text to the outgoing HTTP response stream.

  1.0.5000.0
  2.0.0.0
- Property
  System.IO.Stream a

  Starting with the .NET Framework version 2.0, when you use the method of the IO stream returned by the property, the following exceptions might be thrown:

  , if the or parameter is negative or if the parameter's length minus the parameter is less than or equal to zero.

  , if the parameter is null.

  Enables binary output to the outgoing HTTP content body.

  1.0.5000.0
  2.0.0.0
- Method
  System.Void ``

  Platform for Internet Content Selection (PICS) is a World Wide Web Consortium (W3C) standard for content labeling. PICS is essentially a language for creating a ratings system.

  Any value can be a PICS label; ASP.NET does not validate the label. The maximum length of the string is 255 characters. For more information about PICS standards and syntax, see the World Wide Web Consortium Web site.

  Appends a HTTP PICS-Label header to the output stream.

  The string to add to the PICS-Label header. 1.0.5000.0 2.0.0.0
- Method
  System.Void ``

  Calling is equivalent to calling with the second parameter set to true.

  calls which throws a exception upon completion. This exception has a detrimental effect on Web application performance. Therefore, we recommend that instead of this overload you use the overload and pass false for the parameter, and then call the method. For more information, see the method.

  For mobile pages only, if your application relies on cookieless sessions, or might receive requests from mobile devices that require cookieless sessions, using a tilde (~) in a path can result in creating a new session and potentially losing session data. To set a property on a mobile control with a path such as "~/path", resolve the path using "~/path" before assigning it to the property.

  ASP.NET performs the redirection by returning a 302 HTTP status code. An alternative way to transfer control to another page is the method. The method is typically more efficient because it does not cause a round trip to the client. For more information, see How to: Redirect Users to Another Page.

  Redirects a request to a new URL and specifies the new URL.

  The target location. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` ``

  An absolute URL (for example, http://www.contoso.com/default.aspx) or a relative URL (for example, Default.aspx) can be specified for the target location but some browsers may reject a relative URL.

  When you use this method in a page handler to terminate a request for one page and start a new request for another page, set to false and then call the method. If you specify true for the parameter, this method calls the method for the original request, which throws a exception when it completes. This exception has a detrimental effect on Web application performance, which is why passing false for the parameter is recommended. For more information, see the method.

  For mobile pages, if your application relies on cookieless sessions, or might receive requests from mobile devices that require cookieless sessions, using a tilde (~) in a path can create a new session and potentially lose session data. To set a property on a mobile control with a path such as "~/path", resolve the path using "~/path" before assigning it to the property.

  ASP.NET performs the redirection by returning a 302 HTTP status code. An alternative way to transfer control to another page is the method. The method is typically more efficient because it does not cause a round trip to the client. For more information, see How to: Redirect Users to Another Page.

  Redirects a client to a new URL. Specifies the new URL and whether execution of the current page should terminate.

  The location of the target. Indicates whether execution of the current page should terminate. 1.0.5000.0 2.0.0.0
- Property
  System.String The redirect

  This is a low-level request, for the Location header to be complete you must also update the StatusCode to one of the valid redirection codes (3xx). See the and methods for a high-level interface to redirection.

  If set this property controls whether the header "Location" in the HTTP headers is set. If the value is the header is not sent, any other values will cause the "Location" header to be sent.

  Gets or sets the value of the Http Location header.

  1.0.5000.0
  2.0.0.0
- Method
  System.Void ``

  Call this method to remove output-cache items that are associated with the default output-cache provider. Call the method to remove output-cache items that are associated with custom output-cache providers that are specified in the Web site configuration file.

  Removes from the cache all cached items that are associated with the default output-cache provider. This method is static.

  The virtual absolute path to the items that are removed from the cache. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` The cookie is added to the list of cookies that will be sent back to the HTTP client.

  Updates an existing cookie in the cookie collection.

  The cookie in the collection to be updated. 1.0.5000.0 2.0.0.0
- Property
  System.String The current HTTP status.

  has been deprecated in favor of and is provided only for compatibility with earlier versions of ASP. With ASP.NET, use instead.

  Sets the Status line that is returned to the client.

  1.0.5000.0
  2.0.0.0
- Property
  System.Int32 The current status code. Defaults to 200. This property controls the HTTP status code that is sent back to the HTTP client.

  If the setter method is called after the headers have been set, an will be thrown.

  The following is a list of the RFC defined status codes:

  HTTP Status Code
  Status Description
  100
  Continue
  101
  Switching Protocols
  200
  OK
  201
  Created
  202
  Accepted
  203
  Non-Authoritative Information
  204
  No Content
  205
  Reset Content
  206
  Partial Content
  300
  Multiple Choices
  301
  Moved Permanently
  302
  Found
  303
  See Other
  304
  Not Modified
  305
  Use Proxy
  307
  Temporary Redirect
  400
  Bad Request
  401
  Unauthorized
  402
  Payment Required
  403
  Forbidden
  404
  Not Found
  405
  Method Not Allowed
  406
  Not Acceptable
  407
  Proxy Authentication Required
  408
  Request Time-out
  409
  Conflict
  410
  Gone
  411
  Length Required
  412
  Precondition Failed
  413
  Request Entity Too Large
  414
  Request-URI Too Large
  415
  Unsupported Media Type
  416
  Requested range not satisfiable
  417
  Expectation Failed
  500
  Internal Server Error
  501
  Not Implemented
  502
  Bad Gateway
  503
  Service Unavailable
  504
  Gateway Time-out
  505
  HTTP Version not supported

  Gets or sets the HTTP status code of the output returned to the client.

  1.0.5000.0
  2.0.0.0
- Property
  System.String The current status description that will be returned to the client. The status description is described in RFC 2616, section 6.1.1

  The following is a list of the RFC defined status codes:

  HTTP Status Code
  Status Description
  100
  Continue
  101
  Switching Protocols
  200
  OK
  201
  Created
  202
  Accepted
  203
  Non-Authoritative Information
  204
  No Content
  205
  Reset Content
  206
  Partial Content
  300
  Multiple Choices
  301
  Moved Permanently
  302
  Found
  303
  See Other
  304
  Not Modified
  305
  Use Proxy
  307
  Temporary Redirect
  400
  Bad Request
  401
  Unauthorized
  402
  Payment Required
  403
  Forbidden
  404
  Not Found
  405
  Method Not Allowed
  406
  Not Acceptable
  407
  Proxy Authentication Required
  408
  Request Time-out
  409
  Conflict
  410
  Gone
  411
  Length Required
  412
  Precondition Failed
  413
  Request Entity Too Large
  414
  Request-URI Too Large
  415
  Unsupported Media Type
  416
  Requested range not satisfiable
  417
  Expectation Failed
  500
  Internal Server Error
  501
  Not Implemented
  502
  Bad Gateway
  503
  Service Unavailable
  504
  Gateway Time-out
  505
  HTTP Version not supported

  Gets or sets the HTTP status string of the output returned to the client.

  1.0.5000.0
  2.0.0.0
- Property
  System.Boolean Whether content is currently being supressed (boolean). If the value is set to true no output will be produced. The value can be altered any number of times, it is only consulted at the last stage of processing the request.

  Gets or sets a value indicating whether to send HTTP content to the client.

  1.0.5000.0
  2.0.0.0
- Method
  1.0.5000.0
  2.0.0.0
  System.Void `` To be added.

  Writes the specified file directly to an HTTP response output stream, without buffering it in memory.

  The name of the file to write to the HTTP output.
- Method
  System.Void ``

  Writes a character to an HTTP response output stream.

  The character to write to the HTTP output stream. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` This will invoke method and then write the result to the output stream using the current encoding.

  Writes an to an HTTP response stream.

  The to write to the HTTP output stream. 1.0.5000.0 2.0.0.0
- Method
  System.Void ``

  Dynamically generated HTML pages can introduce security risks if input received from Web clients is not validated either when it is received from a client or when it is transmitted back to a client. Malicious script that is embedded in input submitted to a Web site and later written back out to a client can appear to be originating from a trusted source. This security risk is referred to as a cross-site scripting attack. You should always validate data that is received from a client when it will be transmitted from your site to client browsers.

  Moreover, whenever you write out as HTML any data that was received as input, you should encode it using a technique such as or to prevent malicious script from executing. This technique is useful for data that was not validated when it was received.

  When you encode or filter data, you must specify a character set for your Web pages so that your filter can identify and remove any byte sequences that do not belong to that set (such as nonalphanumeric sequences) and could potentially have malicious script embedded in them.

  For more information about cross-site scripting attacks, see article Q252985, "How to Prevent Cross-Site Scripting Security Issues" on the Microsoft Knowledge Base Web site.

  Writes a string to an HTTP response output stream.

  The string to write to the HTTP output stream. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` `` This writes the specified number of bytes to the HTTP output stream. If either int arguments are negative or if the operation would overflow the buffer an exception is thrown.

  Writes an array of characters to an HTTP response output stream.

  The character array to write. The position in the character array where writing starts. The number of characters to write, beginning at . 1.0.5000.0 2.0.0.0
- Method
  System.Void ``

  When this method is used with large files, calling the method might throw an exception. The size of the file that can be used with this method depends on the hardware configuration of the Web server. For more information, see article 812406, "PRB: Response.WriteFile Cannot Download a Large File" on the Microsoft Knowledge Base Web site.

  Writes the contents of the specified file directly to an HTTP response output stream as a file block.

  The name of the file to write to the HTTP output. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` ``

  When this method is used with large files, calling the method might throw an exception. The size of the file that can be used with this method depends on the hardware configuration of the Web server. For more information, see article 812406, "PRB: Response.WriteFile Cannot Download a Large File" on the Microsoft Knowledge Base Web site.

  Writes the contents of the specified file directly to an HTTP response output stream as a memory block.

  The name of the file to write into a memory block. Indicates whether the file will be written into a memory block. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` ``

  When this method is used with large files, calling the method might throw an exception. The size of the file that can be used with this method depends on the hardware configuration of the Web server. For more information, see article 812406, "PRB: Response.WriteFile Cannot Download a Large File" on the Microsoft Knowledge Base Web site.

  Writes the specified file directly to an HTTP response output stream.

  The file handle of the file to write to the HTTP output stream. The byte position in the file where writing will start. The number of bytes to write to the output stream. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` ``

  When this method is used with large files, calling the method might throw an exception. The size of the file that can be used with this method depends on the hardware configuration of the Web server. For more information, see article 812406, "PRB: Response.WriteFile Cannot Download a Large File" on the Microsoft Knowledge Base Web site.

  Writes the specified file directly to an HTTP response output stream.

  The name of the file to write to the HTTP output stream. The byte position in the file where writing will start. The number of bytes to write to the output stream. 1.0.5000.0 2.0.0.0
- Method
  2.0.0.0
  System.Void ``

  You can use the method for post-cache substitution in your output-cached pages. By passing an object to a callback method with a prescribed signature, you can replace output cached content at any given location in the page cache. To initiate the replacement, call the method, passing it the callback method, which must be thread safe and can be either of the following:

  A static method on the container page or user control.

  A static or instance method on another arbitrary object.

  On the first request to the page, the calls the delegate to produce the output. Then, it adds a substitution buffer to the response, which retains the delegate to call on future requests. Finally, it degrades client-side cacheability from public to server-only, ensuring future requests to the page re-invoke the delegate by not caching on the client.

  Post-cache substitution is not supported for a cached user control where output caching is applied at the user control level. This is also known as fragment caching. For more information, see Caching Portions of an ASP.NET Page.

  Allows insertion of response substitution blocks into the response, which allows dynamic generation of specified response regions for output cached responses.

  The method, user control, or object to substitute.