Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
3688 lines (3249 sloc) 236 KB
<Type Name="HttpResponse" FullName="System.Web.HttpResponse">
<TypeSignature Language="C#" Value="public sealed class HttpResponse" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit HttpResponse extends System.Object" />
<TypeSignature Language="DocId" Value="T:System.Web.HttpResponse" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class HttpResponse" />
<TypeSignature Language="C++ CLI" Value="public ref class HttpResponse sealed" />
<TypeSignature Language="F#" Value="type HttpResponse = class" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Encapsulates HTTP-response information from an ASP.NET operation.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The methods and properties of the <xref:System.Web.HttpResponse> class are exposed through the <xref:System.Web.HttpApplication.Response%2A> property of the <xref:System.Web.HttpApplication>, <xref:System.Web.HttpContext>, <xref:System.Web.UI.Page>, and <xref:System.Web.UI.UserControl> classes.
The following methods of the <xref:System.Web.HttpResponse> class are supported only in post back scenarios and not in asynchronous post back scenarios:
- <xref:System.Web.HttpResponse.BinaryWrite%2A>
- <xref:System.Web.HttpResponse.Clear%2A>
- <xref:System.Web.HttpResponse.ClearContent%2A>
- <xref:System.Web.HttpResponse.ClearHeaders%2A>
- <xref:System.Web.HttpResponse.Close%2A>
- <xref:System.Web.HttpResponse.End%2A>
- <xref:System.Web.HttpResponse.Flush%2A>
- <xref:System.Web.HttpResponse.TransmitFile%2A>
- <xref:System.Web.HttpResponse.Write%2A>
- <xref:System.Web.HttpResponse.WriteFile%2A>
- <xref:System.Web.HttpResponse.WriteSubstitution%2A>
Partial-page updates are enabled when you use <xref:System.Web.UI.UpdatePanel> controls to update selected regions of a page instead of updating the whole page with a post back. For more information, see [UpdatePanel Control Overview](https://msdn.microsoft.com/library/29a2265d-9674-4c19-b70e-e5560ee9689a) and [Partial-Page Rendering Overview](https://msdn.microsoft.com/library/5c12736d-d9e9-464a-9388-3fe0f9f49e49).
## Examples
The following example draws three overlapping rectangles when the page is requested. The code begins by setting the <xref:System.Web.HttpResponse.ContentType%2A> property to image/jpeg, so that the entire page will be rendered as a JPEG image. The code then calls the <xref:System.Web.HttpResponse.Clear%2A> method to ensure that no extraneous content is sent with this response. Next, the code sets the <xref:System.Web.HttpResponse.BufferOutput%2A> property to true so that the page is completely processed before it is sent to the requesting client. Two objects used to draw the rectangles are then created: a <xref:System.Drawing.Bitmap> and a <xref:System.Drawing.Graphics> object. The variables created in the page are used as coordinates to draw the rectangles and a string that appears inside the largest rectangle.
When the three rectangles and the string that appears inside them are drawn, the <xref:System.Drawing.Bitmap> is saved to the <xref:System.IO.Stream> object that is associated with the <xref:System.Web.HttpResponse.OutputStream%2A> property and its format is set to JPEG. The code calls the <xref:System.Drawing.Image.Dispose%2A> and <xref:System.Drawing.Graphics.Dispose%2A> methods to release the resources used by the two drawing objects. Lastly, the code calls the <xref:System.Web.HttpResponse.Flush%2A> method to send the buffered response to the requesting client.
> [!NOTE]
> In code, the <xref:System.Web.HttpResponse> object is referred to by the keyword `Response`. For example, `Response.Clear()` refers to the <xref:System.Web.HttpResponse.Clear%2A?displayProperty=nameWithType> method. The <xref:System.Web.UI.Page> class has a property that is named <xref:System.Web.UI.Page.Response%2A> that exposes the current instance of <xref:System.Web.HttpResponse>.
[!code-aspx-csharp[System.Web.HttpResponse_Samples1#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpResponse_Samples1/CS/responsesamplescs.aspx#1)]
[!code-aspx-vb[System.Web.HttpResponse_Samples1#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.HttpResponse_Samples1/VB/responsesamplesvb.aspx#1)]
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public HttpResponse (System.IO.TextWriter writer);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.IO.TextWriter writer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.#ctor(System.IO.TextWriter)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (writer As TextWriter)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; HttpResponse(System::IO::TextWriter ^ writer);" />
<MemberSignature Language="F#" Value="new System.Web.HttpResponse : System.IO.TextWriter -&gt; System.Web.HttpResponse" Usage="new System.Web.HttpResponse writer" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="writer" Type="System.IO.TextWriter" />
</Parameters>
<Docs>
<param name="writer">A <see cref="T:System.IO.TextWriter" /> object that enables custom HTTP output.</param>
<summary>Initializes a new instance of the <see cref="T:System.Web.HttpResponse" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
The methods and properties of the <xref:System.Web.HttpResponse> class are exposed through the intrinsic <xref:System.Web.HttpContext.Response%2A> object in ASP.NET.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="AddCacheDependency">
<MemberSignature Language="C#" Value="public void AddCacheDependency (params System.Web.Caching.CacheDependency[] dependencies);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddCacheDependency(class System.Web.Caching.CacheDependency[] dependencies) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.AddCacheDependency(System.Web.Caching.CacheDependency[])" />
<MemberSignature Language="VB.NET" Value="Public Sub AddCacheDependency (ParamArray dependencies As CacheDependency())" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AddCacheDependency(... cli::array &lt;System::Web::Caching::CacheDependency ^&gt; ^ dependencies);" />
<MemberSignature Language="F#" Value="member this.AddCacheDependency : System.Web.Caching.CacheDependency[] -&gt; unit" Usage="httpResponse.AddCacheDependency dependencies" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dependencies" Type="System.Web.Caching.CacheDependency[]" Index="0" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<Attributes>
<Attribute>
<AttributeName>System.ParamArray</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="dependencies">A file, cache key, or <see cref="T:System.Web.Caching.CacheDependency" /> to add to the list of application dependencies.</param>
<summary>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.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.HttpResponse.AddCacheDependency%2A> method allows dependencies to be created between cached responses and a <xref:System.Web.Caching.CacheDependency> object.
## Examples
The following example demonstrates how to create a cache dependency by using the <xref:System.Web.HttpResponse.AddCacheDependency%2A> method and a <xref:System.Web.Caching.CacheDependency> object.
[!code-aspx-csharp[HttpResponse.AddCacheDependency#1](~/samples/snippets/csharp/VS_Snippets_WebNet/HttpResponse.AddCacheDependency/CS/httpresponse.addcachedependency_cs.aspx#1)]
[!code-aspx-vb[HttpResponse.AddCacheDependency#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/HttpResponse.AddCacheDependency/VB/httpresponse.addcachedependency_vb.aspx#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="dependencies" /> parameter is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">This method was called too late in the cache processing pipeline, after the cached response was already created.</exception>
<altmember cref="T:System.Web.Caching.CacheDependency" />
<related type="Article" href="https://msdn.microsoft.com/library/e9666a1b-88df-4931-af0b-a754fc65660b(v=vs.100)">Caching ASP.NET Pages</related>
</Docs>
</Member>
<MemberGroup MemberName="AddCacheItemDependencies">
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Makes the validity of a cached response dependent on other items in the cache.</summary>
</Docs>
</MemberGroup>
<Member MemberName="AddCacheItemDependencies">
<MemberSignature Language="C#" Value="public void AddCacheItemDependencies (System.Collections.ArrayList cacheKeys);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddCacheItemDependencies(class System.Collections.ArrayList cacheKeys) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.AddCacheItemDependencies(System.Collections.ArrayList)" />
<MemberSignature Language="VB.NET" Value="Public Sub AddCacheItemDependencies (cacheKeys As ArrayList)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AddCacheItemDependencies(System::Collections::ArrayList ^ cacheKeys);" />
<MemberSignature Language="F#" Value="member this.AddCacheItemDependencies : System.Collections.ArrayList -&gt; unit" Usage="httpResponse.AddCacheItemDependencies cacheKeys" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="cacheKeys" Type="System.Collections.ArrayList" />
</Parameters>
<Docs>
<param name="cacheKeys">The <see cref="T:System.Collections.ArrayList" /> that contains the keys of the items that the current cached response is dependent upon.</param>
<summary>Makes the validity of a cached response dependent on other items in the cache.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When the items referred to in the `cacheKeys` parameter are removed from the cache, the cached response of the current item is not valid.
## Examples
The following example demonstrates how to use an ASP.NET page that is output cached. The code for the page creates an <xref:System.Collections.ArrayList> object of keys that are associated with items that are stored in the <xref:System.Web.Caching.Cache> object. Next, the code passes the <xref:System.Collections.ArrayList> as the parameter in a call to the <xref:System.Web.HttpResponse.AddCacheItemDependencies%2A> method. This makes the output cached response not valid, if any of the files specified in the <xref:System.Collections.ArrayList> change.
[!code-aspx-csharp[System.Web.HttpResponse_Samples2#5](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpResponse_Samples2/CS/cacheitemsdepscs.aspx#5)]
[!code-aspx-vb[System.Web.HttpResponse_Samples2#5](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.HttpResponse_Samples2/VB/cacheitemsdepsvb.aspx#5)]
]]></format>
</remarks>
<altmember cref="T:System.Web.Caching.CacheDependency" />
<related type="Article" href="https://msdn.microsoft.com/library/e9666a1b-88df-4931-af0b-a754fc65660b(v=vs.100)">Caching ASP.NET Pages</related>
</Docs>
</Member>
<Member MemberName="AddCacheItemDependencies">
<MemberSignature Language="C#" Value="public void AddCacheItemDependencies (string[] cacheKeys);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddCacheItemDependencies(string[] cacheKeys) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.AddCacheItemDependencies(System.String[])" />
<MemberSignature Language="VB.NET" Value="Public Sub AddCacheItemDependencies (cacheKeys As String())" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AddCacheItemDependencies(cli::array &lt;System::String ^&gt; ^ cacheKeys);" />
<MemberSignature Language="F#" Value="member this.AddCacheItemDependencies : string[] -&gt; unit" Usage="httpResponse.AddCacheItemDependencies cacheKeys" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="cacheKeys" Type="System.String[]" Index="0" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="cacheKeys">An array of item keys that the cached response is dependent upon.</param>
<summary>Makes the validity of a cached item dependent on another item in the cache.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When any of the `cacheKey`s are removed from the cache, the cached response of the current item is invalid.
]]></format>
</remarks>
<altmember cref="T:System.Web.Caching.CacheDependency" />
<related type="Article" href="https://msdn.microsoft.com/library/e9666a1b-88df-4931-af0b-a754fc65660b(v=vs.100)">Caching ASP.NET Pages</related>
</Docs>
</Member>
<Member MemberName="AddCacheItemDependency">
<MemberSignature Language="C#" Value="public void AddCacheItemDependency (string cacheKey);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddCacheItemDependency(string cacheKey) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.AddCacheItemDependency(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub AddCacheItemDependency (cacheKey As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AddCacheItemDependency(System::String ^ cacheKey);" />
<MemberSignature Language="F#" Value="member this.AddCacheItemDependency : string -&gt; unit" Usage="httpResponse.AddCacheItemDependency cacheKey" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="cacheKey" Type="System.String" />
</Parameters>
<Docs>
<param name="cacheKey">The key of the item that the cached response is dependent upon.</param>
<summary>Makes the validity of a cached response dependent on another item in the cache.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When the item corresponding to the `cacheKey` parameter is removed from the cache, the cached response of the current item is invalid.
## Examples
The following example is an ASP.NET user control that is output cached. The code for the control calls the <xref:System.Web.HttpResponse.AddCacheItemDependency%2A> method with the key of an item stored in the <xref:System.Web.Caching.Cache> object passed as its parameter. If the item does not exist in the cache, the control's response that was stored in the output cache is invalidated. This means that on the subsequent request, a new version of the control's response will be added to the output cache.
Next, the code checks whether an item associated with a `bookData` key is stored in the `Cache` object, and displays one of two lines of text dependent upon the result. Then, the code sets the <xref:System.Web.UI.WebControls.BaseDataList.DataSource%2A> property of a <xref:System.Web.UI.WebControls.DataGrid> control, which is named `dgBooks`, with a call to a custom `DataHelper` class' shared `GetBookData` method, and populates the <xref:System.Web.UI.WebControls.DataGrid> with the <xref:System.Web.UI.Control.DataBind%2A> method.
[!code-aspx-csharp[System.Web.HttpResponse_Samples2#3](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpResponse_Samples2/CS/bookscs.ascx#3)]
[!code-aspx-vb[System.Web.HttpResponse_Samples2#3](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.HttpResponse_Samples2/VB/booksvb.ascx#3)]
]]></format>
</remarks>
<altmember cref="M:System.Web.HttpResponse.AddCacheItemDependency(System.String)" />
<related type="Article" href="https://msdn.microsoft.com/library/e9666a1b-88df-4931-af0b-a754fc65660b(v=vs.100)">Caching ASP.NET Pages</related>
</Docs>
</Member>
<MemberGroup MemberName="AddFileDependencies">
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Adds a group of file names to the collection of file names on which the current response is dependent.</summary>
</Docs>
</MemberGroup>
<Member MemberName="AddFileDependencies">
<MemberSignature Language="C#" Value="public void AddFileDependencies (System.Collections.ArrayList filenames);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddFileDependencies(class System.Collections.ArrayList filenames) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.AddFileDependencies(System.Collections.ArrayList)" />
<MemberSignature Language="VB.NET" Value="Public Sub AddFileDependencies (filenames As ArrayList)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AddFileDependencies(System::Collections::ArrayList ^ filenames);" />
<MemberSignature Language="F#" Value="member this.AddFileDependencies : System.Collections.ArrayList -&gt; unit" Usage="httpResponse.AddFileDependencies filenames" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="filenames" Type="System.Collections.ArrayList" />
</Parameters>
<Docs>
<param name="filenames">The collection of files to add.</param>
<summary>Adds a group of file names to the collection of file names on which the current response is dependent.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example is an ASP.NET page that is output cached. The code for the page creates an <xref:System.Collections.ArrayList> of file paths, and then passes the <xref:System.Collections.ArrayList> as the parameter in a call to the <xref:System.Web.HttpResponse.AddFileDependencies%2A> method. This makes the output cached response invalid if any of the files specified in the <xref:System.Collections.ArrayList> changes.
[!code-aspx-csharp[System.Web.HttpResponse_Samples2#6](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpResponse_Samples2/CS/responsefiledepscs.aspx#6)]
[!code-aspx-vb[System.Web.HttpResponse_Samples2#6](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.HttpResponse_Samples2/VB/responsefiledepsvb.aspx#6)]
]]></format>
</remarks>
<altmember cref="T:System.Web.Caching.CacheDependency" />
<related type="Article" href="https://msdn.microsoft.com/library/e9666a1b-88df-4931-af0b-a754fc65660b(v=vs.100)">Caching ASP.NET Pages</related>
</Docs>
</Member>
<Member MemberName="AddFileDependencies">
<MemberSignature Language="C#" Value="public void AddFileDependencies (string[] filenames);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddFileDependencies(string[] filenames) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.AddFileDependencies(System.String[])" />
<MemberSignature Language="VB.NET" Value="Public Sub AddFileDependencies (filenames As String())" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AddFileDependencies(cli::array &lt;System::String ^&gt; ^ filenames);" />
<MemberSignature Language="F#" Value="member this.AddFileDependencies : string[] -&gt; unit" Usage="httpResponse.AddFileDependencies filenames" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="filenames" Type="System.String[]" Index="0" FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="filenames">An array of files to add.</param>
<summary>Adds an array of file names to the collection of file names on which the current response is dependent.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example adds an array of file names to the <xref:System.Web.HttpResponse.AddFileDependencies%2A> file dependency list. If the files changes, the cached response is invalidated.
[!code-aspx-csharp[Response.AddFileDependency#1](~/samples/snippets/csharp/VS_Snippets_WebNet/Response.AddFileDependency/CS/addfiledependency_cs.aspx#1)]
[!code-aspx-vb[Response.AddFileDependency#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/Response.AddFileDependency/VB/addfiledependency_vb.aspx#1)]
]]></format>
</remarks>
<related type="Article" href="https://msdn.microsoft.com/library/e9666a1b-88df-4931-af0b-a754fc65660b(v=vs.100)">Caching ASP.NET Pages</related>
</Docs>
</Member>
<Member MemberName="AddFileDependency">
<MemberSignature Language="C#" Value="public void AddFileDependency (string filename);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddFileDependency(string filename) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.AddFileDependency(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub AddFileDependency (filename As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AddFileDependency(System::String ^ filename);" />
<MemberSignature Language="F#" Value="member this.AddFileDependency : string -&gt; unit" Usage="httpResponse.AddFileDependency filename" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="filename" Type="System.String" />
</Parameters>
<Docs>
<param name="filename">The name of the file to add.</param>
<summary>Adds a single file name to the collection of file names on which the current response is dependent.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When you use the <xref:System.Web.HttpResponse.AddFileDependency%2A> 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](https://msdn.microsoft.com/library/28a9e101-fb44-4198-9cb6-b8a52312fec2) directive. For more information, see [How to: Cache Page Output with File Dependencies](https://msdn.microsoft.com/library/95ad1c54-329e-45af-9343-a03a1d2ce9db).
## Examples
The following example shows how to add a single file name to the <xref:System.Web.HttpResponse.AddFileDependency%2A> file dependency list. If the file changes, the cached response is invalidated.
[!code-csharp[Classic HttpResponse.AddFileDependency Example#1](~/samples/snippets/csharp/VS_Snippets_WebNet/Classic HttpResponse.AddFileDependency Example/CS/source.cs#1)]
[!code-vb[Classic HttpResponse.AddFileDependency Example#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/Classic HttpResponse.AddFileDependency Example/VB/source.vb#1)]
]]></format>
</remarks>
<related type="Article" href="https://msdn.microsoft.com/library/e9666a1b-88df-4931-af0b-a754fc65660b(v=vs.100)">Caching ASP.NET Pages</related>
</Docs>
</Member>
<Member MemberName="AddHeader">
<MemberSignature Language="C#" Value="public void AddHeader (string name, string value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddHeader(string name, string value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.AddHeader(System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub AddHeader (name As String, value As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AddHeader(System::String ^ name, System::String ^ value);" />
<MemberSignature Language="F#" Value="member this.AddHeader : string * string -&gt; unit" Usage="httpResponse.AddHeader (name, value)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
<Parameter Name="value" Type="System.String" />
</Parameters>
<Docs>
<param name="name">The name of the HTTP header to add <paramref name="value" /> to.</param>
<param name="value">The string to add to the header.</param>
<summary>Adds an HTTP header to the output stream. <see cref="M:System.Web.HttpResponse.AddHeader(System.String,System.String)" /> is provided for compatibility with earlier versions of ASP.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Web.HttpResponse.AddHeader%2A> is the same as <xref:System.Web.HttpResponse.AppendHeader%2A> and is provided only for compatibility with earlier versions of ASP. With ASP.NET, use <xref:System.Web.HttpResponse.AppendHeader%2A>.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="AddOnSendingHeaders">
<MemberSignature Language="C#" Value="public System.Web.ISubscriptionToken AddOnSendingHeaders (Action&lt;System.Web.HttpContext&gt; callback);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Web.ISubscriptionToken AddOnSendingHeaders(class System.Action`1&lt;class System.Web.HttpContext&gt; callback) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.AddOnSendingHeaders(System.Action{System.Web.HttpContext})" />
<MemberSignature Language="VB.NET" Value="Public Function AddOnSendingHeaders (callback As Action(Of HttpContext)) As ISubscriptionToken" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Web::ISubscriptionToken ^ AddOnSendingHeaders(Action&lt;System::Web::HttpContext ^&gt; ^ callback);" />
<MemberSignature Language="F#" Value="member this.AddOnSendingHeaders : Action&lt;System.Web.HttpContext&gt; -&gt; System.Web.ISubscriptionToken" Usage="httpResponse.AddOnSendingHeaders callback" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.ISubscriptionToken</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="callback" Type="System.Action&lt;System.Web.HttpContext&gt;" Index="0" FrameworkAlternate="netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="callback">The callback method.</param>
<summary>Registers a callback that the ASP.NET runtime will invoke immediately before response headers are sent for this request.</summary>
<returns>An <see cref="T:System.Web.ISubscriptionToken" /> object that represents the subscription to the OnSendingHeaders pseudo-event.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
> [!IMPORTANT]
> The AddOnSendingHeaders method is not invoked if the native module flushes the response first.
The pseudo-event OnSendingHeaders differs from the IHttpModule-level pipeline event in that it is a per-request subscription rather than a per-application subscription. The intent is that the callback may modify the response status code or may set a response cookie or header. Other usage notes and caveats:
- This method is effective only when IIS runs in integrated pipeline mode pipeline and only if response headers haven't yet been sent for the current request.
- The ASP.NET runtime does not guarantee anything about the thread that the callback is invoked on. For example, the callback may be invoked synchronously in a background thread if a background flush is being performed. <xref:System.Web.HttpContext.Current%2A> is not guaranteed to be available in such a thread.
- The callback must not call any method that manipulates the response entity body or that results in a flush. For example, the callback must not call <xref:System.Web.HttpResponse.Redirect%2A>, as that method may manipulate the response entity body.
- The callback must contain only short-running synchronous code. Attempting to invoke an asynchronous operation or wait on such an operation could result in a deadlock.
- The callback must not throw an exception; otherwise behavior is undefined.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="AppendCookie">
<MemberSignature Language="C#" Value="public void AppendCookie (System.Web.HttpCookie cookie);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AppendCookie(class System.Web.HttpCookie cookie) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.AppendCookie(System.Web.HttpCookie)" />
<MemberSignature Language="VB.NET" Value="Public Sub AppendCookie (cookie As HttpCookie)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AppendCookie(System::Web::HttpCookie ^ cookie);" />
<MemberSignature Language="F#" Value="member this.AppendCookie : System.Web.HttpCookie -&gt; unit" Usage="httpResponse.AppendCookie cookie" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="cookie" Type="System.Web.HttpCookie" />
</Parameters>
<Docs>
<param name="cookie">The <see cref="T:System.Web.HttpCookie" /> to add to the output stream.</param>
<summary>Adds an HTTP cookie to the intrinsic cookie collection.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example creates a new cookie named `LastVisit`, sets the value of the cookie to the current date and time, and appends the cookie to the current cookie collection. All cookies in the cookie collection are sent to the client in the `Set-Cookie` header with the HTTP output stream.
[!code-csharp[Classic HttpResponse.AppendCookie Example#1](~/samples/snippets/csharp/VS_Snippets_WebNet/Classic HttpResponse.AppendCookie Example/CS/source.cs#1)]
[!code-vb[Classic HttpResponse.AppendCookie Example#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/Classic HttpResponse.AppendCookie Example/VB/source.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.Web.HttpException">A cookie is appended after the HTTP headers have been sent.</exception>
</Docs>
</Member>
<Member MemberName="AppendHeader">
<MemberSignature Language="C#" Value="public void AppendHeader (string name, string value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AppendHeader(string name, string value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.AppendHeader(System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub AppendHeader (name As String, value As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AppendHeader(System::String ^ name, System::String ^ value);" />
<MemberSignature Language="F#" Value="member this.AppendHeader : string * string -&gt; unit" Usage="httpResponse.AppendHeader (name, value)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
<Parameter Name="value" Type="System.String" />
</Parameters>
<Docs>
<param name="name">The name of the HTTP header to add to the output stream.</param>
<param name="value">The string to append to the header.</param>
<summary>Adds an HTTP header to the output stream.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If you use the <xref:System.Web.HttpResponse.AppendHeader%2A> method to send cache-specific headers and at the same time use the cache object model (<xref:System.Web.HttpResponse.Cache%2A>) 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 <xref:System.Web.HttpCachePolicy.SetCacheability%2A>, 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](https://go.microsoft.com/fwlink/?LinkID=73147) specification on the World Wide Web Consortium (W3C) Web site.
## Examples
The following example calls the <xref:System.Web.HttpResponse.AppendHeader%2A> method to add a custom header to the <xref:System.Web.HttpResponse> object sent to the requesting client.
[!code-csharp[System.Web.HttpResponse.AppendHeader_Example#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpResponse.AppendHeader_Example/CS/responseappendheader.cs.aspx#1)]
[!code-vb[System.Web.HttpResponse.AppendHeader_Example#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.HttpResponse.AppendHeader_Example/VB/responseappendheader.vb.aspx#1)]
]]></format>
</remarks>
<exception cref="T:System.Web.HttpException">The header is appended after the HTTP headers have been sent.</exception>
</Docs>
</Member>
<Member MemberName="AppendToLog">
<MemberSignature Language="C#" Value="public void AppendToLog (string param);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AppendToLog(string param) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.AppendToLog(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub AppendToLog (param As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AppendToLog(System::String ^ param);" />
<MemberSignature Language="F#" Value="member this.AppendToLog : string -&gt; unit" Usage="httpResponse.AppendToLog param" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="param" Type="System.String" />
</Parameters>
<Docs>
<param name="param">The text to add to the log file.</param>
<summary>Adds custom log information to the Internet Information Services (IIS) log file.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
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:
1. 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**.
2. Click the **Web or FTP Site** tab, and then select the **Enable logging** check box (if it is not already selected).
3. In the **Active log format** box, click **W3C Extended Log File Format**.
4. Click **Properties**.
5. Click the **Advanced** tab, select the properties that you want to log, and then click **OK**.
## Examples
The following example shows how to append a string to the log.
[!code-csharp[Classic HttpResponse.AppendToLog Example#1](~/samples/snippets/csharp/VS_Snippets_WebNet/Classic HttpResponse.AppendToLog Example/CS/source.cs#1)]
[!code-vb[Classic HttpResponse.AppendToLog Example#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/Classic HttpResponse.AppendToLog Example/VB/source.vb#1)]
]]></format>
</remarks>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=36829">Windows Server 2003 Product Help</related>
</Docs>
</Member>
<Member MemberName="ApplyAppPathModifier">
<MemberSignature Language="C#" Value="public string ApplyAppPathModifier (string virtualPath);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance string ApplyAppPathModifier(string virtualPath) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.ApplyAppPathModifier(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Function ApplyAppPathModifier (virtualPath As String) As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::String ^ ApplyAppPathModifier(System::String ^ virtualPath);" />
<MemberSignature Language="F#" Value="member this.ApplyAppPathModifier : string -&gt; string" Usage="httpResponse.ApplyAppPathModifier virtualPath" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="virtualPath" Type="System.String" />
</Parameters>
<Docs>
<param name="virtualPath">The virtual path to a resource.</param>
<summary>Adds a session ID to the virtual path if the session is using <see cref="P:System.Web.Configuration.SessionStateSection.Cookieless" /> session state and returns the combined path. If <see cref="P:System.Web.Configuration.SessionStateSection.Cookieless" /> session state is not used, <see cref="M:System.Web.HttpResponse.ApplyAppPathModifier(System.String)" /> returns the original virtual path.</summary>
<returns>The <paramref name="virtualPath" /> with the session ID inserted.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Web.HttpResponse.ApplyAppPathModifier%2A> is used only with cookieless sessions to construct absolute HREFs.
## Examples
The following example declares a string variable named `urlConverted`, and sets it to the result of an <xref:System.Web.HttpResponse.ApplyAppPathModifier%2A> method call. The code then passes the variable's value to a <xref:System.Web.UI.WebControls.HyperLink> control's <xref:System.Web.UI.WebControls.HyperLink.NavigateUrl%2A> property.
[!code-csharp[System.Web.HttpResponse_Sample5#5](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpResponse_Sample5/CS/responseapppathmodifiercs.aspx#5)]
[!code-vb[System.Web.HttpResponse_Sample5#5](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.HttpResponse_Sample5/VB/responseapppathmodifiervb.aspx#5)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BeginFlush">
<MemberSignature Language="C#" Value="public IAsyncResult BeginFlush (AsyncCallback callback, object state);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.IAsyncResult BeginFlush(class System.AsyncCallback callback, object state) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.BeginFlush(System.AsyncCallback,System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Function BeginFlush (callback As AsyncCallback, state As Object) As IAsyncResult" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; IAsyncResult ^ BeginFlush(AsyncCallback ^ callback, System::Object ^ state);" />
<MemberSignature Language="F#" Value="member this.BeginFlush : AsyncCallback * obj -&gt; IAsyncResult" Usage="httpResponse.BeginFlush (callback, state)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IAsyncResult</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="callback" Type="System.AsyncCallback" Index="0" FrameworkAlternate="netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="state" Type="System.Object" Index="1" FrameworkAlternate="netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="callback">The callback object.</param>
<param name="state">The response state.</param>
<summary>Sends the currently buffered response to the client.</summary>
<returns>The asynchronous result object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the underlying <xref:System.Web.HttpWorkerRequest> object supports asynchronous flush operations and this method is called from an asynchronous module event or from an asynchronous handler, the flush operation is performed asynchronously. Otherwise, the flush operation is performed synchronously. Asynchronous flush is supported for IIS 6.0 and later.
]]></format>
</remarks>
<exception cref="T:System.Web.HttpException">The response is already completed.</exception>
</Docs>
</Member>
<Member MemberName="BinaryWrite">
<MemberSignature Language="C#" Value="public void BinaryWrite (byte[] buffer);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void BinaryWrite(unsigned int8[] buffer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.BinaryWrite(System.Byte[])" />
<MemberSignature Language="VB.NET" Value="Public Sub BinaryWrite (buffer As Byte())" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void BinaryWrite(cli::array &lt;System::Byte&gt; ^ buffer);" />
<MemberSignature Language="F#" Value="member this.BinaryWrite : byte[] -&gt; unit" Usage="httpResponse.BinaryWrite buffer" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="buffer" Type="System.Byte[]" />
</Parameters>
<Docs>
<param name="buffer">The bytes to write to the output stream.</param>
<summary>Writes a string of binary characters to the HTTP output stream.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example reads a text file into a buffer and writes the buffer to the HTTP output stream.
[!code-csharp[Classic HttpResponse.BinaryWrite Example#1](~/samples/snippets/csharp/VS_Snippets_WebNet/Classic HttpResponse.BinaryWrite Example/CS/source.cs#1)]
[!code-vb[Classic HttpResponse.BinaryWrite Example#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/Classic HttpResponse.BinaryWrite Example/VB/source.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Buffer">
<MemberSignature Language="C#" Value="public bool Buffer { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool Buffer" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.Buffer" />
<MemberSignature Language="VB.NET" Value="Public Property Buffer As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool Buffer { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.Buffer : bool with get, set" Usage="System.Web.HttpResponse.Buffer" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether to buffer output and send it after the complete response is finished processing.</summary>
<value>
<see langword="true" /> if the output to client is buffered; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.HttpResponse.Buffer%2A> property has been deprecated in favor of the <xref:System.Web.HttpResponse.BufferOutput%2A> property and is provided only for compatibility with earlier versions of ASP. With ASP.NET, use <xref:System.Web.HttpResponse.BufferOutput%2A>.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BufferOutput">
<MemberSignature Language="C#" Value="public bool BufferOutput { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool BufferOutput" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.BufferOutput" />
<MemberSignature Language="VB.NET" Value="Public Property BufferOutput As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool BufferOutput { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.BufferOutput : bool with get, set" Usage="System.Web.HttpResponse.BufferOutput" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether to buffer output and send it after the complete page is finished processing.</summary>
<value>
<see langword="true" /> if the output to client is buffered; otherwise <see langword="false" />. The default is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example sets the <xref:System.Web.HttpResponse.ContentType%2A> property for the response to image/jpeg, calls the <xref:System.Web.HttpResponse.Clear%2A> method to remove other content that might be attached to the response, and then sets the <xref:System.Web.HttpResponse.BufferOutput%2A> property to true so that the entire page will be processed before any content is sent to the requesting client.
For a complete example, see the <xref:System.Web.HttpResponse> class.
[!code-csharp[System.Web.HttpResponse_Samples1#2](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpResponse_Samples1/CS/responsesamplescs.aspx#2)]
[!code-vb[System.Web.HttpResponse_Samples1#2](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.HttpResponse_Samples1/VB/responsesamplesvb.aspx#2)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Cache">
<MemberSignature Language="C#" Value="public System.Web.HttpCachePolicy Cache { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.HttpCachePolicy Cache" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.Cache" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Cache As HttpCachePolicy" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Web::HttpCachePolicy ^ Cache { System::Web::HttpCachePolicy ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Cache : System.Web.HttpCachePolicy" Usage="System.Web.HttpResponse.Cache" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.HttpCachePolicy</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the caching policy (such as expiration time, privacy settings, and vary clauses) of a Web page.</summary>
<value>An <see cref="T:System.Web.HttpCachePolicy" /> object that contains information about the caching policy of the current response.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example writes properties of the current cache policy to the HTTP output stream.
[!code-csharp[Classic HttpResponse.Cache Example#1](~/samples/snippets/csharp/VS_Snippets_WebNet/Classic HttpResponse.Cache Example/CS/source.cs#1)]
[!code-vb[Classic HttpResponse.Cache Example#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/Classic HttpResponse.Cache Example/VB/source.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CacheControl">
<MemberSignature Language="C#" Value="public string CacheControl { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string CacheControl" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.CacheControl" />
<MemberSignature Language="VB.NET" Value="Public Property CacheControl As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ CacheControl { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.CacheControl : string with get, set" Usage="System.Web.HttpResponse.CacheControl" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the <see langword="Cache-Control" /> HTTP header that matches one of the <see cref="T:System.Web.HttpCacheability" /> enumeration values.</summary>
<value>A string representation of the <see cref="T:System.Web.HttpCacheability" /> enumeration value.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The values for `Private`, `Public`, and `No-Cache` are strings and must be enclosed in quotation marks (" "). If the <xref:System.Web.HttpResponse.CacheControl%2A> property is set to a value that does not match one of the <xref:System.Web.HttpCacheability> enumeration values, then an <xref:System.ArgumentException> is thrown. If the <xref:System.Web.HttpResponse.CacheControl%2A> property is not set, the cacheability of the response is set to <xref:System.Web.HttpCacheability.NoCache>.
The `CacheControl`, <xref:System.Web.HttpResponse.Expires%2A>, and <xref:System.Web.HttpResponse.ExpiresAbsolute%2A> properties have been deprecated. Instead, the methods of the <xref:System.Web.HttpCachePolicy> class are available through the <xref:System.Web.HttpResponse.Cache%2A> intrinsic object to control the Internet Information Services (IIS) output cache and client caches.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The string value set does not match one of the <see cref="T:System.Web.HttpCacheability" /> enumeration values.</exception>
</Docs>
</Member>
<Member MemberName="Charset">
<MemberSignature Language="C#" Value="public string Charset { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Charset" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.Charset" />
<MemberSignature Language="VB.NET" Value="Public Property Charset As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ Charset { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.Charset : string with get, set" Usage="System.Web.HttpResponse.Charset" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the HTTP character set of the output stream.</summary>
<value>The HTTP character set of the output stream.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The `Charset` property can be set to `null` to suppress the HTTP `Content-Type` header.
## Examples
The following example checks whether the character set of the output stream is Central European (ISO).
[!code-csharp[System.Web.HttpResponse.Charset#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpResponse.Charset/cs/default.aspx#1)]
[!code-vb[System.Web.HttpResponse.Charset#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.HttpResponse.Charset/vb/default.aspx#1)]
]]></format>
</remarks>
<exception cref="T:System.Web.HttpException">The <see langword="Charset" /> property was set after headers were sent.</exception>
</Docs>
</Member>
<Member MemberName="Clear">
<MemberSignature Language="C#" Value="public void Clear ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Clear() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.Clear" />
<MemberSignature Language="VB.NET" Value="Public Sub Clear ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Clear();" />
<MemberSignature Language="F#" Value="member this.Clear : unit -&gt; unit" Usage="httpResponse.Clear " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Clears all content output from the buffer stream.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.HttpResponse.Clear%2A> method does not clear header information.
## Examples
The following example sets the <xref:System.Web.HttpResponse.ContentType%2A> property for the response to image/jpeg, calls the <xref:System.Web.HttpResponse.Clear%2A> method to remove other content that might be attached to the response, and then sets the <xref:System.Web.HttpResponse.BufferOutput%2A> property to true so that the complete page will be processed before any content is sent to the requesting client.
For a complete example, see the <xref:System.Web.HttpResponse> class.
[!code-csharp[System.Web.HttpResponse_Samples1#2](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpResponse_Samples1/CS/responsesamplescs.aspx#2)]
[!code-vb[System.Web.HttpResponse_Samples1#2](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.HttpResponse_Samples1/VB/responsesamplesvb.aspx#2)]
]]></format>
</remarks>
<altmember cref="M:System.Web.HttpResponse.ClearHeaders" />
</Docs>
</Member>
<Member MemberName="ClearContent">
<MemberSignature Language="C#" Value="public void ClearContent ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void ClearContent() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.ClearContent" />
<MemberSignature Language="VB.NET" Value="Public Sub ClearContent ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void ClearContent();" />
<MemberSignature Language="F#" Value="member this.ClearContent : unit -&gt; unit" Usage="httpResponse.ClearContent " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Clears all content output from the buffer stream.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.HttpResponse.ClearContent%2A> method does not clear header information.
## Examples
The following example clears all content from the buffer stream.
[!code-csharp[Classic HttpResponse.ClearContent Example#1](~/samples/snippets/csharp/VS_Snippets_WebNet/Classic HttpResponse.ClearContent Example/CS/source.cs#1)]
[!code-vb[Classic HttpResponse.ClearContent Example#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/Classic HttpResponse.ClearContent Example/VB/source.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Web.HttpResponse.ClearHeaders" />
</Docs>
</Member>
<Member MemberName="ClearHeaders">
<MemberSignature Language="C#" Value="public void ClearHeaders ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void ClearHeaders() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.ClearHeaders" />
<MemberSignature Language="VB.NET" Value="Public Sub ClearHeaders ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void ClearHeaders();" />
<MemberSignature Language="F#" Value="member this.ClearHeaders : unit -&gt; unit" Usage="httpResponse.ClearHeaders " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Clears all headers from the buffer stream.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example calls the <xref:System.Web.HttpResponse.ClearHeaders%2A> method to ensure that no headers are sent with the current response. This technique can be especially important if the ASP.NET response is generating an image, such as a JPEG file. In this example the <xref:System.Web.HttpResponse.ContentType%2A> property is set to image/jpeg.
[!code-csharp[System.Web.HttpResponse_Sample5#2](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpResponse_Sample5/CS/httpresponseclearheaderscs.aspx#2)]
[!code-vb[System.Web.HttpResponse_Sample5#2](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.HttpResponse_Sample5/VB/httpresponseclearheadersvb.aspx#2)]
]]></format>
</remarks>
<exception cref="T:System.Web.HttpException">Headers are cleared after the HTTP headers have been sent.</exception>
<altmember cref="M:System.Web.HttpResponse.ClearContent" />
</Docs>
</Member>
<Member MemberName="ClientDisconnectedToken">
<MemberSignature Language="C#" Value="public System.Threading.CancellationToken ClientDisconnectedToken { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Threading.CancellationToken ClientDisconnectedToken" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.ClientDisconnectedToken" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property ClientDisconnectedToken As CancellationToken" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Threading::CancellationToken ClientDisconnectedToken { System::Threading::CancellationToken get(); };" />
<MemberSignature Language="F#" Value="member this.ClientDisconnectedToken : System.Threading.CancellationToken" Usage="System.Web.HttpResponse.ClientDisconnectedToken" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.CancellationToken</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a <see cref="T:System.Threading.CancellationToken" /> object that is tripped when the client disconnects.</summary>
<value>The cancellation token.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This API is thread-safe. However, there are some restrictions on how the cancellation token should be used. Using it incorrectly can lead to race conditions, deadlocks, or other unexpected behavior. Keep in mind the following guidelines:
- Ensure that you don't call into this API outside the bounds of a single request, because ASP.NET will dispose of the cancellation token at the end of the request. There is no guarantee that the token will ever transition to a canceled state before it is disposed. For example, if the request finishes without the client having disconnected, the token will be disposed without having first been canceled.
- Do not wait on the <xref:System.Threading.CancellationToken.WaitHandle%2A?displayProperty=nameWithType>, as this defeats the purpose of an asynchronous notification and can cause deadlocks.
- Do not call the <xref:System.Threading.CancellationToken.Register%2A?displayProperty=nameWithType> overloads which invoke the callback on the original <xref:System.Threading.SynchronizationContext> object.
- Do not use the <xref:System.Web.HttpContext> object or other non-thread-safe ASP.NET intrinsic objects from within the callback provided to the <xref:System.Threading.CancellationToken.Register%2A?displayProperty=nameWithType> method. The callback may be running concurrently with other ASP.NET or application code.
- Keep the callback methods short-running and non-blocking.
- Make every effort to avoid throwing exceptions from within the callback methods.
This property is only supported in Internet Information Service (IIS) 7.5 or higher in integrated mode. If you invoke it without the right IIS version or pipeline mode, a <xref:System.PlatformNotSupportedException> is thrown. To determine the IIS version, use <xref:System.Web.HttpRuntime.IISVersion%2A>. To determine the pipeline mode, use <xref:System.Web.HttpRuntime.UsingIntegratedPipeline%2A>.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Close">
<MemberSignature Language="C#" Value="public void Close ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Close() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.Close" />
<MemberSignature Language="VB.NET" Value="Public Sub Close ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Close();" />
<MemberSignature Language="F#" Value="member this.Close : unit -&gt; unit" Usage="httpResponse.Close " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Closes the socket connection to a client.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
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.
However, typically you should call <xref:System.Web.HttpApplication.CompleteRequest%2A> instead if you want to jump ahead to the <xref:System.Web.HttpApplication.EndRequest> event and send a response to the client.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ContentEncoding">
<MemberSignature Language="C#" Value="public System.Text.Encoding ContentEncoding { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Text.Encoding ContentEncoding" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.ContentEncoding" />
<MemberSignature Language="VB.NET" Value="Public Property ContentEncoding As Encoding" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Text::Encoding ^ ContentEncoding { System::Text::Encoding ^ get(); void set(System::Text::Encoding ^ value); };" />
<MemberSignature Language="F#" Value="member this.ContentEncoding : System.Text.Encoding with get, set" Usage="System.Web.HttpResponse.ContentEncoding" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Text.Encoding</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the HTTP character set of the output stream.</summary>
<value>A <see cref="T:System.Text.Encoding" /> object that contains information about the character set of the current response.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Default `ContentEncoding` can be specified in an ASP.NET configuration file in the [globalization Element (ASP.NET Settings Schema)](https://msdn.microsoft.com/library/e2dffc8e-ebd2-439b-a2fd-e3ac5e620da7) section. If <xref:System.Web.HttpResponse.ContentEncoding%2A> is specified by the client, the default configuration settings are overridden.
## Examples
The following example writes a human-readable description of the character set encoding to the output stream.
[!code-csharp[Classic HttpResponse.ContentEncoding Example#1](~/samples/snippets/csharp/VS_Snippets_WebNet/Classic HttpResponse.ContentEncoding Example/CS/source.cs#1)]
[!code-vb[Classic HttpResponse.ContentEncoding Example#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/Classic HttpResponse.ContentEncoding Example/VB/source.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">Attempted to set <see cref="P:System.Web.HttpResponse.ContentEncoding" /> to <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="ContentType">
<MemberSignature Language="C#" Value="public string ContentType { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ContentType" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.ContentType" />
<MemberSignature Language="VB.NET" Value="Public Property ContentType As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ ContentType { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.ContentType : string with get, set" Usage="System.Web.HttpResponse.ContentType" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the HTTP MIME type of the output stream.</summary>
<value>The HTTP MIME type of the output stream. The default value is "<see langword="text/html" />".</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example sets the <xref:System.Web.HttpResponse.ContentType%2A> property for the response to image/jpeg, calls the <xref:System.Web.HttpResponse.Clear%2A> method to remove other content that might be attached to the response, and then sets the <xref:System.Web.HttpResponse.BufferOutput%2A> property to true so that the complete page will be processed before any content is sent to the requesting client.
For a complete example, see the <xref:System.Web.HttpResponse> class.
[!code-csharp[System.Web.HttpResponse_Samples1#2](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpResponse_Samples1/CS/responsesamplescs.aspx#2)]
[!code-vb[System.Web.HttpResponse_Samples1#2](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.HttpResponse_Samples1/VB/responsesamplesvb.aspx#2)]
]]></format>
</remarks>
<exception cref="T:System.Web.HttpException">The <see cref="P:System.Web.HttpResponse.ContentType" /> property is set to <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Cookies">
<MemberSignature Language="C#" Value="public System.Web.HttpCookieCollection Cookies { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.HttpCookieCollection Cookies" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.Cookies" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Cookies As HttpCookieCollection" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Web::HttpCookieCollection ^ Cookies { System::Web::HttpCookieCollection ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Cookies : System.Web.HttpCookieCollection" Usage="System.Web.HttpResponse.Cookies" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.HttpCookieCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the response cookie collection.</summary>
<value>The response cookie collection.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
ASP.NET includes two intrinsic cookie collections. The collection accessed through the <xref:System.Web.HttpRequest.Cookies%2A> collection of <xref:System.Web.HttpRequest> contains cookies transmitted by the client to the server in the `Cookie` header. The collection accessed through the <xref:System.Web.HttpResponse.Cookies%2A> collection of <xref:System.Web.HttpResponse> 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 <xref:System.Web.HttpResponse.Cookies%2A?displayProperty=nameWithType> collection, the cookie is immediately available in the <xref:System.Web.HttpRequest.Cookies%2A?displayProperty=nameWithType> collection, even if the response has not been sent to the client.
## Examples
The following example creates a new cookie named `LastVisit`, sets the value of the cookie to the current date and time, and adds the cookie to the current cookie collection. All cookies in the cookie collection are sent to the client in the `Set-Cookie` header with the HTTP output stream.
[!code-csharp[Classic HttpResponse.Cookies Example#1](~/samples/snippets/csharp/VS_Snippets_WebNet/Classic HttpResponse.Cookies Example/CS/source.cs#1)]
[!code-vb[Classic HttpResponse.Cookies Example#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/Classic HttpResponse.Cookies Example/VB/source.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="DisableKernelCache">
<MemberSignature Language="C#" Value="public void DisableKernelCache ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void DisableKernelCache() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.DisableKernelCache" />
<MemberSignature Language="VB.NET" Value="Public Sub DisableKernelCache ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void DisableKernelCache();" />
<MemberSignature Language="F#" Value="member this.DisableKernelCache : unit -&gt; unit" Usage="httpResponse.DisableKernelCache " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Disables kernel caching for the current response.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If kernel caching is not supported, this method has no effect.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="DisableUserCache">
<MemberSignature Language="C#" Value="public void DisableUserCache ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void DisableUserCache() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.DisableUserCache" />
<MemberSignature Language="VB.NET" Value="Public Sub DisableUserCache ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void DisableUserCache();" />
<MemberSignature Language="F#" Value="member this.DisableUserCache : unit -&gt; unit" Usage="httpResponse.DisableUserCache " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Disables IIS user-mode caching for this response.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If IIS user-mode caching is not supported, this method returns without performing any action.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="End">
<MemberSignature Language="C#" Value="public void End ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void End() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.End" />
<MemberSignature Language="VB.NET" Value="Public Sub End ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void End();" />
<MemberSignature Language="F#" Value="member this.End : unit -&gt; unit" Usage="httpResponse.End " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Sends all currently buffered output to the client, stops execution of the page, and raises the <see cref="E:System.Web.HttpApplication.EndRequest" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
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 <xref:System.Web.HttpApplication.EndRequest> event and send a response to the client, it is usually preferable to call <xref:System.Web.HttpApplication.CompleteRequest%2A> instead.
To mimic the behavior of the `End` method in ASP, this method tries to raise a <xref:System.Threading.ThreadAbortException> 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 <xref:System.Web.HttpResponse.End%2A> method is executed.
If the <xref:System.Web.HttpResponse.End%2A> method is not able to raise a <xref:System.Threading.ThreadAbortException>, 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 <xref:System.Threading.ThreadAbortException> exception is successfully raised), the response pipeline jumps ahead to the <xref:System.Web.HttpApplication.EndRequest> event.
The <xref:System.Web.HttpApplication.CompleteRequest%2A> method does not raise an exception, and code after the call to the <xref:System.Web.HttpApplication.CompleteRequest%2A> method might be executed. If your intention is to avoid execution of subsequent code, and if the performance penalty of <xref:System.Web.HttpResponse.End%2A> is acceptable, you can call <xref:System.Web.HttpResponse.End%2A> instead of <xref:System.Web.HttpApplication.CompleteRequest%2A>.
]]></format>
</remarks>
<exception cref="T:System.Threading.ThreadAbortException">The call to <see cref="M:System.Web.HttpResponse.End" /> has terminated the current request.</exception>
</Docs>
</Member>
<Member MemberName="EndFlush">
<MemberSignature Language="C#" Value="public void EndFlush (IAsyncResult asyncResult);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void EndFlush(class System.IAsyncResult asyncResult) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.EndFlush(System.IAsyncResult)" />
<MemberSignature Language="VB.NET" Value="Public Sub EndFlush (asyncResult As IAsyncResult)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void EndFlush(IAsyncResult ^ asyncResult);" />
<MemberSignature Language="F#" Value="member this.EndFlush : IAsyncResult -&gt; unit" Usage="httpResponse.EndFlush asyncResult" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="asyncResult" Type="System.IAsyncResult" Index="0" FrameworkAlternate="netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="asyncResult">The asynchronous result object.</param>
<summary>Completes an asynchronous flush operation.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">Asynchronous flush is not supported and the <paramref name="asyncResult" /> parameter is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">Asynchronous flush is not supported and the <paramref name="asyncResult" /> parameter cannot be cast to a <c>FlushAsyncResult</c> object.</exception>
</Docs>
</Member>
<Member MemberName="Expires">
<MemberSignature Language="C#" Value="public int Expires { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Expires" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.Expires" />
<MemberSignature Language="VB.NET" Value="Public Property Expires As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int Expires { int get(); void set(int value); };" />
<MemberSignature Language="F#" Value="member this.Expires : int with get, set" Usage="System.Web.HttpResponse.Expires" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>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. <see cref="P:System.Web.HttpResponse.Expires" /> is provided for compatibility with earlier versions of ASP.</summary>
<value>The number of minutes before the page expires.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The `Expires`, <xref:System.Web.HttpResponse.ExpiresAbsolute%2A> and <xref:System.Web.HttpResponse.CacheControl%2A> properties have been deprecated in favor of the methods of the <xref:System.Web.HttpCachePolicy> class available through the <xref:System.Web.HttpResponse.Cache%2A> intrinsic object to control the Internet Information Services (IIS) output cache and client caches.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ExpiresAbsolute">
<MemberSignature Language="C#" Value="public DateTime ExpiresAbsolute { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.DateTime ExpiresAbsolute" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.ExpiresAbsolute" />
<MemberSignature Language="VB.NET" Value="Public Property ExpiresAbsolute As DateTime" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property DateTime ExpiresAbsolute { DateTime get(); void set(DateTime value); };" />
<MemberSignature Language="F#" Value="member this.ExpiresAbsolute : DateTime with get, set" Usage="System.Web.HttpResponse.ExpiresAbsolute" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.DateTime</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the absolute date and time at which to remove cached information from the cache. <see cref="P:System.Web.HttpResponse.ExpiresAbsolute" /> is provided for compatibility with earlier versions of ASP.</summary>
<value>The date and time at which the page expires.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The `ExpiresAbsolute`, <xref:System.Web.HttpResponse.Expires%2A>, and <xref:System.Web.HttpResponse.CacheControl%2A> properties have been deprecated in favor of the methods of the <xref:System.Web.HttpCachePolicy> class available through the <xref:System.Web.HttpResponse.Cache%2A> intrinsic object to control the Internet Information Services (IIS) output cache and client caches.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Filter">
<MemberSignature Language="C#" Value="public System.IO.Stream Filter { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.IO.Stream Filter" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.Filter" />
<MemberSignature Language="VB.NET" Value="Public Property Filter As Stream" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::IO::Stream ^ Filter { System::IO::Stream ^ get(); void set(System::IO::Stream ^ value); };" />
<MemberSignature Language="F#" Value="member this.Filter : System.IO.Stream with get, set" Usage="System.Web.HttpResponse.Filter" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IO.Stream</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a wrapping filter object that is used to modify the HTTP entity body before transmission.</summary>
<value>The <see cref="T:System.IO.Stream" /> object that acts as the output filter.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When you create a `Stream` object and set the <xref:System.Web.HttpResponse.Filter%2A> property to the `Stream` object, all HTTP output sent by <xref:System.Web.HttpResponse.Write%2A> passes through the filter.
## Examples
The following example is an ASP.NET page that sets the <xref:System.Web.HttpResponse.Filter%2A> property to a new instance of the `UpperCaseFilter` class, a custom <xref:System.IO.Stream> class that converts all text that passes through it to uppercase. The information about the request is saved to a text file, and then the <xref:System.Web.HttpResponse.Filter%2A> property is set. After the response filter is in place, the code calls the <xref:System.Web.HttpRequest.MapPath%2A> method to get the absolute path to a text file named `TestFile.txt` that serves as the source for the content of the response. The code then creates a new <xref:System.IO.StreamReader> object to read the text file from beginning to end, and then calls the <xref:System.Web.HttpResponse.Write%2A> method to display the content of the file on the page.
[!code-aspx-csharp[System.Web.HttpRequest_Samples2#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpRequest_Samples2/CS/requestsamples2cs.aspx#1)]
[!code-aspx-vb[System.Web.HttpRequest_Samples2#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.HttpRequest_Samples2/VB/requestsamples2vb.aspx#1)]
]]></format>
</remarks>
<exception cref="T:System.Web.HttpException">Filtering is not allowed with the entity.</exception>
</Docs>
</Member>
<Member MemberName="Flush">
<MemberSignature Language="C#" Value="public void Flush ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Flush() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.Flush" />
<MemberSignature Language="VB.NET" Value="Public Sub Flush ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Flush();" />
<MemberSignature Language="F#" Value="member this.Flush : unit -&gt; unit" Usage="httpResponse.Flush " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Sends all currently buffered output to the client.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Forces all currently buffered output to be sent to the client. The <xref:System.Web.HttpResponse.Flush%2A> method can be called multiple times during request processing.
## Examples
The following example calls the <xref:System.Drawing.Graphics.Save%2A> method to save a <xref:System.Drawing.Bitmap> object to the <xref:System.Web.HttpResponse.OutputStream%2A> property and converts the image to the JPEG format. The code then calls the `Dispose` method on the <xref:System.Drawing.Bitmap> object and a <xref:System.Drawing.Graphics> object, releasing the resources that they were using. It then calls the <xref:System.Web.HttpResponse.Flush%2A> method to send the content of the response to the requesting client.
For a complete example, see the <xref:System.Web.HttpResponse> class.
[!code-aspx-csharp[System.Web.HttpResponse_Samples1#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpResponse_Samples1/CS/responsesamplescs.aspx#1)]
[!code-aspx-vb[System.Web.HttpResponse_Samples1#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.HttpResponse_Samples1/VB/responsesamplesvb.aspx#1)]
]]></format>
</remarks>
<exception cref="T:System.Web.HttpException">The cache is flushed after the response has been sent.</exception>
</Docs>
</Member>
<Member MemberName="FlushAsync">
<MemberSignature Language="C#" Value="public System.Threading.Tasks.Task FlushAsync ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Threading.Tasks.Task FlushAsync() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.FlushAsync" />
<MemberSignature Language="VB.NET" Value="Public Function FlushAsync () As Task" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Threading::Tasks::Task ^ FlushAsync();" />
<MemberSignature Language="F#" Value="member this.FlushAsync : unit -&gt; System.Threading.Tasks.Task" Usage="httpResponse.FlushAsync " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Asynchronously sends all currently buffered output to the client.</summary>
<returns>A <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous operation.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="HeaderEncoding">
<MemberSignature Language="C#" Value="public System.Text.Encoding HeaderEncoding { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Text.Encoding HeaderEncoding" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.HeaderEncoding" />
<MemberSignature Language="VB.NET" Value="Public Property HeaderEncoding As Encoding" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Text::Encoding ^ HeaderEncoding { System::Text::Encoding ^ get(); void set(System::Text::Encoding ^ value); };" />
<MemberSignature Language="F#" Value="member this.HeaderEncoding : System.Text.Encoding with get, set" Usage="System.Web.HttpResponse.HeaderEncoding" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Text.Encoding</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets an <see cref="T:System.Text.Encoding" /> object that represents the encoding for the current header output stream.</summary>
<value>An <see cref="T:System.Text.Encoding" /> that contains information about the character set for the current header.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.HttpResponse.HeaderEncoding%2A> property gives you the ability to disable or change the <xref:System.Text.Encoding> object on a response header by using the <xref:System.Text.ASCIIEncoding>, <xref:System.Text.UnicodeEncoding>, <xref:System.Text.UTF7Encoding>, or <xref:System.Text.UTF8Encoding> object. The default encoding value is the <xref:System.Text.UTF8Encoding> class.
By changing the type of the <xref:System.Web.HttpResponse.HeaderEncoding%2A> 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 <xref:System.Web.HttpResponse.HeaderEncoding%2A> 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 <xref:System.Web.HttpResponse.HeaderEncoding%2A> 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.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The encoding value is <see langword="null" />.</exception>
<exception cref="T:System.Web.HttpException">The encoding value is <see cref="P:System.Text.Encoding.Unicode" />.
-or-
The headers have already been sent.</exception>
</Docs>
</Member>
<Member MemberName="Headers">
<MemberSignature Language="C#" Value="public System.Collections.Specialized.NameValueCollection Headers { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Specialized.NameValueCollection Headers" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.Headers" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Headers As NameValueCollection" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Collections::Specialized::NameValueCollection ^ Headers { System::Collections::Specialized::NameValueCollection ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Headers : System.Collections.Specialized.NameValueCollection" Usage="System.Web.HttpResponse.Headers" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.Specialized.NameValueCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the collection of response headers.</summary>
<value>A <see cref="T:System.Collections.Specialized.NameValueCollection" /> of response headers.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.HttpResponse.Headers%2A> property is only supported with the [!INCLUDE[iisver](~/includes/iisver-md.md)] integrated pipeline mode and at least the .NET Framework 3.0. When you try to access the <xref:System.Web.HttpResponse.Headers%2A> property and either of these two conditions is not met, a <xref:System.PlatformNotSupportedException> is thrown.
]]></format>
</remarks>
<exception cref="T:System.PlatformNotSupportedException">The operation requires the integrated pipeline mode in [!INCLUDE[iisver](~/includes/iisver-md.md)] and at least the .NET Framework version 3.0.</exception>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=86952">Upgrading ASP.NET Applications to IIS 7.0: Differences between IIS 7.0 Integrated Mode and Classic mode</related>
</Docs>
</Member>
<Member MemberName="HeadersWritten">
<MemberSignature Language="C#" Value="public bool HeadersWritten { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool HeadersWritten" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.HeadersWritten" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property HeadersWritten As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool HeadersWritten { bool get(); };" />
<MemberSignature Language="F#" Value="member this.HeadersWritten : bool" Usage="System.Web.HttpResponse.HeadersWritten" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating whether the response headers have been written.</summary>
<value>
<see langword="true" /> if the response headers have been written; otherwise, <see langword="false" />.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="IsClientConnected">
<MemberSignature Language="C#" Value="public bool IsClientConnected { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsClientConnected" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.IsClientConnected" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property IsClientConnected As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool IsClientConnected { bool get(); };" />
<MemberSignature Language="F#" Value="member this.IsClientConnected : bool" Usage="System.Web.HttpResponse.IsClientConnected" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating whether the client is still connected to the server.</summary>
<value>
<see langword="true" /> if the client is currently connected; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.HttpResponse.IsClientConnected%2A> property returns `false` when the following conditions are true:
- The connection to the client was terminated. This can occur if the <xref:System.Web.HttpResponse.Close%2A> method was invoked, or if the client stopped execution of the Web page or browsed to another page.
- The <xref:System.Web.HttpWorkerRequest> object that is handling the request is `null` or the <xref:System.Web.HttpWorkerRequest.IsClientConnected%2A?displayProperty=nameWithType> method returns `false`. If a custom <xref:System.Web.HttpWorkerRequest> object handles the request, then the <xref:System.Web.HttpWorkerRequest.IsClientConnected%2A?displayProperty=nameWithType> method might be set based on custom criteria. For example, the custom worker request might force a time-out after a period of time.
## Examples
The following example uses the <xref:System.Web.HttpResponse.IsClientConnected%2A> property to check whether the client that is requesting the page remains connected to the server. If <xref:System.Web.HttpResponse.IsClientConnected%2A> is true, the code calls the <xref:System.Web.HttpResponse.Redirect%2A> method, and the client will view another page. If <xref:System.Web.HttpResponse.IsClientConnected%2A> is false, then the code calls the <xref:System.Web.HttpResponse.End%2A> method and all page processing is terminated.
[!code-aspx-csharp[System.Web.HttpResponse_Sample4#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpResponse_Sample4/CS/page1cs.aspx#1)]
[!code-aspx-vb[System.Web.HttpResponse_Sample4#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.HttpResponse_Sample4/VB/page1vb.aspx#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="IsRequestBeingRedirected">
<MemberSignature Language="C#" Value="public bool IsRequestBeingRedirected { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsRequestBeingRedirected" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.IsRequestBeingRedirected" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property IsRequestBeingRedirected As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool IsRequestBeingRedirected { bool get(); };" />
<MemberSignature Language="F#" Value="member this.IsRequestBeingRedirected : bool" Usage="System.Web.HttpResponse.IsRequestBeingRedirected" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a Boolean value indicating whether the client is being transferred to a new location.</summary>
<value>
<see langword="true" /> if the value of the location response header is different than the current location; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.HttpResponse.IsRequestBeingRedirected%2A> property with the <xref:System.Web.HttpResponse.RedirectLocation%2A> 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.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Output">
<MemberSignature Language="C#" Value="public System.IO.TextWriter Output { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.IO.TextWriter Output" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.Output" />
<MemberSignature Language="VB.NET" Value="Public Property Output As TextWriter" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::IO::TextWriter ^ Output { System::IO::TextWriter ^ get(); void set(System::IO::TextWriter ^ value); };" />
<MemberSignature Language="F#" Value="member this.Output : System.IO.TextWriter with get, set" Usage="System.Web.HttpResponse.Output" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.IO.TextWriter</ReturnType>
</ReturnValue>
<Docs>
<summary>Enables output of text to the outgoing HTTP response stream.</summary>
<value>A <see cref="T:System.IO.TextWriter" /> object that enables custom output to the client.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example is an ASP.NET page that contains a <xref:System.Web.UI.WebControls.TextBox> control that has its <xref:System.Web.UI.WebControls.TextBox.TextMode%2A> property set to <xref:System.Web.UI.WebControls.TextBoxMode.MultiLine>. The page's code takes the text that a user enters in the <xref:System.Web.UI.WebControls.TextBox.TextMode%2A>, uses the <xref:System.Web.HttpServerUtility.HtmlEncode%2A> method to HTML encode it, and the <xref:System.Web.HttpResponse.Output%2A> property to display the encoded string to the page.
[!code-aspx-csharp[System.Web.HttpResponse.Output_Sample#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpResponse.Output_Sample/CS/responseoutputcs.aspx#1)]
[!code-aspx-vb[System.Web.HttpResponse.Output_Sample#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.HttpResponse.Output_Sample/VB/responseoutputvb.aspx#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="OutputStream">
<MemberSignature Language="C#" Value="public System.IO.Stream OutputStream { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.IO.Stream OutputStream" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.OutputStream" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property OutputStream As Stream" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::IO::Stream ^ OutputStream { System::IO::Stream ^ get(); };" />
<MemberSignature Language="F#" Value="member this.OutputStream : System.IO.Stream" Usage="System.Web.HttpResponse.OutputStream" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IO.Stream</ReturnType>
</ReturnValue>
<Docs>
<summary>Enables binary output to the outgoing HTTP content body.</summary>
<value>An IO <see cref="T:System.IO.Stream" /> representing the raw contents of the outgoing HTTP content body.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Starting with the .NET Framework version 2.0, when you use the <xref:System.IO.Stream.Write%28System.Byte%5B%5D%2CSystem.Int32%2CSystem.Int32%29?displayProperty=nameWithType> method of the IO stream returned by the <xref:System.Web.HttpResponse.OutputStream%2A> property, the following exceptions might be thrown:
- <xref:System.ArgumentOutOfRangeException>, if the `offset` or `count` parameter is negative or if the `buffer` parameter's length minus the `offset` parameter is less than or equal to zero.
- <xref:System.ArgumentNullException>, if the `buffer` parameter is `null`.
## Examples
The following example calls the <xref:System.Drawing.Image.Save%2A> method to save a <xref:System.Drawing.Bitmap> object to the <xref:System.Web.HttpResponse.OutputStream%2A> property, and converts the image to the JPEG format. The code then calls the Dispose method on the <xref:System.Drawing.Bitmap> object and a <xref:System.Drawing.Graphics> object, releasing the resources that they were using. Finally, the code calls the <xref:System.Web.HttpResponse.Flush%2A> method to send the content of the response to the requesting client.
For a complete example, see the <xref:System.Web.HttpResponse> class.
[!code-aspx-csharp[System.Web.HttpResponse_Samples1#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpResponse_Samples1/CS/responsesamplescs.aspx#1)]
[!code-aspx-vb[System.Web.HttpResponse_Samples1#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.HttpResponse_Samples1/VB/responsesamplesvb.aspx#1)]
]]></format>
</remarks>
<exception cref="T:System.Web.HttpException">
<paramref name="OutputStream" /> is not available.</exception>
</Docs>
</Member>
<Member MemberName="Pics">
<MemberSignature Language="C#" Value="public void Pics (string value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Pics(string value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.Pics(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub Pics (value As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Pics(System::String ^ value);" />
<MemberSignature Language="F#" Value="member this.Pics : string -&gt; unit" Usage="httpResponse.Pics value" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.String" />
</Parameters>
<Docs>
<param name="value">The string to add to the <see langword="PICS-Label" /> header.</param>
<summary>Appends a HTTP <see langword="PICS-Label" /> header to the output stream.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
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](https://go.microsoft.com/fwlink/?LinkID=37125) Web site.
## Examples
The following example is an ASP.NET page that displays an image. The page code calls the <xref:System.Web.HttpResponse.Pics%2A> method to set the HTTP `PICS-Label` header for the response. The string that is passed as the parameter to the <xref:System.Web.HttpResponse.Pics%2A> method represents a rating label generated from the Internet Content Rating Association (ICRA) Web site.
[!code-aspx-csharp[System.Web.HttpResponse_Sample4#2](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpResponse_Sample4/CS/page2cs.aspx#2)]
[!code-aspx-vb[System.Web.HttpResponse_Sample4#2](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.HttpResponse_Sample4/VB/page2vb.aspx#2)]
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="PushPromise">
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Promotes a promised object.</summary>
</Docs>
</MemberGroup>
<Member MemberName="PushPromise">
<MemberSignature Language="C#" Value="public void PushPromise (string path);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void PushPromise(string path) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.PushPromise(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub PushPromise (path As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void PushPromise(System::String ^ path);" />
<MemberSignature Language="F#" Value="member this.PushPromise : string -&gt; unit" Usage="httpResponse.PushPromise path" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="path" Type="System.String" Index="0" FrameworkAlternate="netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="path">The URL of the push request. It should be the virtual path of the relative resource that the server wants to push to the client.</param>
<summary>This API is to support applications sending push promises to HTTP 2.0 clients. You can find more details regarding to Http2 server push at <see href="https://http2.github.io/http2-spec/#PushResources">HTTP/2 Specification Section 8.2: Server Push</see>.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
PushPromise is non-deterministic and applications shouldn't have logic that depends on it. Its only purpose is performance advantage in some cases. There are many conditions (protocol and implementation) that may cause to ignore the push requests completely. The expectation is based on fire-and-forget.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="PushPromise">
<MemberSignature Language="C#" Value="public void PushPromise (string path, string method, System.Collections.Specialized.NameValueCollection headers);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void PushPromise(string path, string method, class System.Collections.Specialized.NameValueCollection headers) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.PushPromise(System.String,System.String,System.Collections.Specialized.NameValueCollection)" />
<MemberSignature Language="VB.NET" Value="Public Sub PushPromise (path As String, method As String, headers As NameValueCollection)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void PushPromise(System::String ^ path, System::String ^ method, System::Collections::Specialized::NameValueCollection ^ headers);" />
<MemberSignature Language="F#" Value="member this.PushPromise : string * string * System.Collections.Specialized.NameValueCollection -&gt; unit" Usage="httpResponse.PushPromise (path, method, headers)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="path" Type="System.String" Index="0" FrameworkAlternate="netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="method" Type="System.String" Index="1" FrameworkAlternate="netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="headers" Type="System.Collections.Specialized.NameValueCollection" Index="2" FrameworkAlternate="netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="path">The URL of the push request. It should be the virtual path of the relative resource that the server wants to push to the client.</param>
<param name="method">Http request method that would be used by the push request.</param>
<param name="headers">Http request header that would be used by the push request.</param>
<summary>This API is to support applications sending push promises to HTTP 2.0 clients. You can find more details regarding to Http2 server push at <see href="https://http2.github.io/http2-spec/#PushResources">HTTP/2 Specification Section 8.2: Server Push</see>.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
PushPromise is non-deterministic and applications shouldn't have logic that depends on it. Its only purpose is performance advantage in some cases. There are many conditions (protocol and implementation) that may cause to ignore the push requests completely. The expectation is based on fire-and-forget.
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="Redirect">
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Redirects a client to a new URL.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Redirect">
<MemberSignature Language="C#" Value="public void Redirect (string url);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Redirect(string url) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.Redirect(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub Redirect (url As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Redirect(System::String ^ url);" />
<MemberSignature Language="F#" Value="member this.Redirect : string -&gt; unit" Usage="httpResponse.Redirect url" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="url" Type="System.String" />
</Parameters>
<Docs>
<param name="url">The target location. This may be an application-relative virtual path.</param>
<summary>Redirects a request to a new URL and specifies the new URL.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Calling <xref:System.Web.HttpResponse.Redirect%2A> is equivalent to calling <xref:System.Web.HttpResponse.Redirect%2A> with the second parameter set to `true`.
<xref:System.Web.HttpResponse.Redirect%2A> calls <xref:System.Web.HttpResponse.End%2A> which throws a <xref:System.Threading.ThreadAbortException> exception upon completion. This exception has a detrimental effect on Web application performance. Therefore, we recommend that instead of this overload you use the <xref:System.Web.HttpResponse.Redirect%28System.String%2CSystem.Boolean%29?displayProperty=nameWithType> overload and pass `false` for the `endResponse` parameter, and then call the <xref:System.Web.HttpApplication.CompleteRequest%2A> method. For more information, see the <xref:System.Web.HttpResponse.End%2A> method.
> [!NOTE]
> 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 <xref:System.Web.UI.MobileControls.MobileControl.ResolveUrl%2A> "\~/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 <xref:System.Web.HttpServerUtility.Transfer%2A> method. The <xref:System.Web.HttpServerUtility.Transfer%2A> 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](https://msdn.microsoft.com/library/daef3f43-e018-43aa-b43c-46b27bac599e).
## Examples
The following example forces an unconditional redirection to another Web site.
[!code-csharp[Classic HttpResponse.Redirect Example#1](~/samples/snippets/csharp/VS_Snippets_WebNet/Classic HttpResponse.Redirect Example/CS/source.cs#1)]
[!code-vb[Classic HttpResponse.Redirect Example#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/Classic HttpResponse.Redirect Example/VB/source.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.Web.HttpException">A redirection is attempted after the HTTP headers have been sent.</exception>
</Docs>
</Member>
<Member MemberName="Redirect">
<MemberSignature Language="C#" Value="public void Redirect (string url, bool endResponse);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Redirect(string url, bool endResponse) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.Redirect(System.String,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Sub Redirect (url As String, endResponse As Boolean)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Redirect(System::String ^ url, bool endResponse);" />
<MemberSignature Language="F#" Value="member this.Redirect : string * bool -&gt; unit" Usage="httpResponse.Redirect (url, endResponse)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="url" Type="System.String" />
<Parameter Name="endResponse" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="url">The location of the target.</param>
<param name="endResponse">Indicates whether execution of the current page should terminate.</param>
<summary>Redirects a client to a new URL. Specifies the new URL and whether execution of the current page should terminate.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
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 `endResponse` to `false` and then call the <xref:System.Web.HttpApplication.CompleteRequest%2A> method. If you specify `true` for the `endResponse` parameter, this method calls the <xref:System.Web.HttpResponse.End%2A> method for the original request, which throws a <xref:System.Threading.ThreadAbortException> exception when it completes. This exception has a detrimental effect on Web application performance, which is why passing `false` for the `endResponse` parameter is recommended. For more information, see the <xref:System.Web.HttpResponse.End%2A> method.
> [!NOTE]
> 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 <xref:System.Web.UI.MobileControls.MobileControl.ResolveUrl%2A> "\~/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 <xref:System.Web.HttpServerUtility.Transfer%2A> method. The <xref:System.Web.HttpServerUtility.Transfer%2A> 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](https://msdn.microsoft.com/library/daef3f43-e018-43aa-b43c-46b27bac599e).
## Examples
The following example uses the <xref:System.Web.HttpResponse.IsClientConnected%2A> property to check whether the client that is requesting the page remains connected to the server. If <xref:System.Web.HttpResponse.IsClientConnected%2A> is true, the code calls the <xref:System.Web.HttpResponse.Redirect%2A> method, and the client will view another page. If <xref:System.Web.HttpResponse.IsClientConnected%2A> is false, then the code calls the <xref:System.Web.HttpResponse.End%2A> method and all page processing is terminated.
[!code-aspx-csharp[System.Web.HttpResponse_Sample4#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.HttpResponse_Sample4/CS/page1cs.aspx#1)]
[!code-aspx-vb[System.Web.HttpResponse_Sample4#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.HttpResponse_Sample4/VB/page1vb.aspx#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="url" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="url" /> contains a newline character.</exception>
<exception cref="T:System.Web.HttpException">A redirection is attempted after the HTTP headers have been sent.</exception>
<exception cref="T:System.ApplicationException">The page request is the result of a callback.</exception>
</Docs>
</Member>
<Member MemberName="RedirectLocation">
<MemberSignature Language="C#" Value="public string RedirectLocation { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string RedirectLocation" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpResponse.RedirectLocation" />
<MemberSignature Language="VB.NET" Value="Public Property RedirectLocation As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ RedirectLocation { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.RedirectLocation : string with get, set" Usage="System.Web.HttpResponse.RedirectLocation" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the value of the HTTP <see langword="Location" /> header.</summary>
<value>The absolute URI that is transmitted to the client in the HTTP <see langword="Location" /> header.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to use this property to specify the redirect URL when you code a permanent redirect by using the HTTP 301 response code.
```csharp
Response.StatusCode = 301;
Response.Status = "301 Moved Permanently";
Response.RedirectLocation = "http://www.newurl.com ";
Response.End();
```
]]></format>
</remarks>
<exception cref="T:System.Web.HttpException">The HTTP headers have already been written.</exception>
</Docs>
</Member>
<MemberGroup MemberName="RedirectPermanent">
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Performs a permanent redirection from a requested URL to a specified URL.</summary>
</Docs>
</MemberGroup>
<Member MemberName="RedirectPermanent">
<MemberSignature Language="C#" Value="public void RedirectPermanent (string url);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RedirectPermanent(string url) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.RedirectPermanent(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub RedirectPermanent (url As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void RedirectPermanent(System::String ^ url);" />
<MemberSignature Language="F#" Value="member this.RedirectPermanent : string -&gt; unit" Usage="httpResponse.RedirectPermanent url" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="url" Type="System.String" Index="0" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="url">The location to redirect the request to.</param>
<summary>Performs a permanent redirection from the requested URL to the specified URL.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.HttpResponse.RedirectPermanent%28System.String%29> method overload provides a 301 HTTP status code in the response and includes the URL to redirect the request to. A 301 HTTP status code is a standard code in an HTTP response. It indicates that a permanent redirection exists, and it provides the redirection location.
Calling the <xref:System.Web.HttpResponse.RedirectPermanent%28System.String%29> method overload terminates the response.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="url" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="url" /> includes a newline character (<c>\n</c>).</exception>
</Docs>
</Member>
<Member MemberName="RedirectPermanent">
<MemberSignature Language="C#" Value="public void RedirectPermanent (string url, bool endResponse);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RedirectPermanent(string url, bool endResponse) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.RedirectPermanent(System.String,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Sub RedirectPermanent (url As String, endResponse As Boolean)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void RedirectPermanent(System::String ^ url, bool endResponse);" />
<MemberSignature Language="F#" Value="member this.RedirectPermanent : string * bool -&gt; unit" Usage="httpResponse.RedirectPermanent (url, endResponse)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="url" Type="System.String" Index="0" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="endResponse" Type="System.Boolean" Index="1" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="url">The location to redirect the request to.</param>
<param name="endResponse">
<see langword="true" /> to terminate the response; otherwise <see langword="false" />. The default is <see langword="false" />.</param>
<summary>Performs a permanent redirection from the requested URL to the specified URL, and provides the option to complete the response.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.HttpResponse.RedirectPermanent%28System.String%2CSystem.Boolean%29> method overload provides a 301 HTTP status code in the response and includes the URL to redirect the request to. This method overload also provides the option to specify whether to terminate or to complete the response after the redirection has been performed. A 301 HTTP status code is a standard code in an HTTP response. It indicates that a permanent redirection exists, and it provides the redirection location.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="url" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="url" /> includes a newline character (<c>\n</c>).</exception>
</Docs>
</Member>
<MemberGroup MemberName="RedirectToRoute">
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Redirects a request to a new URL by using route parameter values, a route name, or both.</summary>
</Docs>
</MemberGroup>
<Member MemberName="RedirectToRoute">
<MemberSignature Language="C#" Value="public void RedirectToRoute (object routeValues);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RedirectToRoute(object routeValues) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.RedirectToRoute(System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Sub RedirectToRoute (routeValues As Object)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void RedirectToRoute(System::Object ^ routeValues);" />
<MemberSignature Language="F#" Value="member this.RedirectToRoute : obj -&gt; unit" Usage="httpResponse.RedirectToRoute routeValues" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="routeValues" Type="System.Object" Index="0" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="routeValues">The route parameter values.</param>
<summary>Redirects a request to a new URL by using route parameter values.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is provided for coding convenience. It is equivalent to calling the <xref:System.Web.HttpResponse.Redirect%28System.String%2CSystem.Boolean%29> method with the second parameter set to `false`.
This method converts the object that is passed in `routeValues` to a <xref:System.Web.Routing.RouteValueDictionary?displayProperty=nameWithType> object by using the <xref:System.Web.Routing.RouteValueDictionary.%23ctor%28System.Object%29?displayProperty=nameWithType> constructor. The <xref:System.Web.Routing.RouteCollection.GetVirtualPath%2A?displayProperty=nameWithType> method is then called to determine the URL.
ASP.NET performs the redirection by returning a 302 HTTP status code.
## Examples
The following example shows how to call this method to redirect to a route that has parameters that are named `productid` and `category`.
```vb
Response.RedirectToRoute(
New With {.productid = "1", .category = "widgets"})
```
```csharp
Response.RedirectToRoute(
new { productid = "1", category = "widgets" });
```
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">No route corresponds to the specified route parameters.</exception>
<exception cref="T:System.Web.HttpException">Redirection was attempted after the HTTP headers had been sent.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/892441af-8f1d-483e-ab5f-b82c23576f5a">ASP.NET Routing</related>
</Docs>
</Member>
<Member MemberName="RedirectToRoute">
<MemberSignature Language="C#" Value="public void RedirectToRoute (string routeName);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RedirectToRoute(string routeName) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.RedirectToRoute(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub RedirectToRoute (routeName As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void RedirectToRoute(System::String ^ routeName);" />
<MemberSignature Language="F#" Value="member this.RedirectToRoute : string -&gt; unit" Usage="httpResponse.RedirectToRoute routeName" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="routeName" Type="System.String" Index="0" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="routeName">The name of the route.</param>
<summary>Redirects a request to a new URL by using a route name.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is provided for coding convenience. It is equivalent to calling the <xref:System.Web.HttpResponse.Redirect%28System.String%2CSystem.Boolean%29> method with the second parameter set to `false`.
This method converts the route name that is passed in `routeName` to a URL by using the <xref:System.Web.Routing.RouteCollection.GetVirtualPath%2A?displayProperty=nameWithType> method.
ASP.NET performs the redirection by returning a 302 HTTP status code.
## Examples
The following example shows how to call this method to redirect to a route that is named `Products`.
```vb
Response.RedirectToRoute("Products")
```
```csharp
Response.RedirectToRoute("Products");
```
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">No route corresponds to the specified route parameters.</exception>
<exception cref="T:System.Web.HttpException">Redirection was attempted after the HTTP headers had been sent.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/892441af-8f1d-483e-ab5f-b82c23576f5a">ASP.NET Routing</related>
</Docs>
</Member>
<Member MemberName="RedirectToRoute">
<MemberSignature Language="C#" Value="public void RedirectToRoute (System.Web.Routing.RouteValueDictionary routeValues);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RedirectToRoute(class System.Web.Routing.RouteValueDictionary routeValues) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.RedirectToRoute(System.Web.Routing.RouteValueDictionary)" />
<MemberSignature Language="VB.NET" Value="Public Sub RedirectToRoute (routeValues As RouteValueDictionary)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void RedirectToRoute(System::Web::Routing::RouteValueDictionary ^ routeValues);" />
<MemberSignature Language="F#" Value="member this.RedirectToRoute : System.Web.Routing.RouteValueDictionary -&gt; unit" Usage="httpResponse.RedirectToRoute routeValues" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="routeValues" Type="System.Web.Routing.RouteValueDictionary" Index="0" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="routeValues">The route parameter values.</param>
<summary>Redirects a request to a new URL by using route parameter values.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is provided for coding convenience. It is equivalent to calling the <xref:System.Web.HttpResponse.Redirect%28System.String%2CSystem.Boolean%29> method with the second parameter set to `false`.
This method calls the <xref:System.Web.Routing.RouteCollection.GetVirtualPath%2A?displayProperty=nameWithType> method to determine the URL.
ASP.NET performs the redirection by returning a 302 HTTP status code.
## Examples
The following example shows how to call this method to redirect to a route that has parameters that are named `productid` and `category`.
```vb
Response.RedirectToRoute(
new RouteValueDictionary {productId="1", category="widgets"})
```
```csharp
Response.RedirectToRoute(
(new RouteValueDictionary {productId="1", category="widgets"});
```
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">No route corresponds to the specified route parameters.</exception>
<exception cref="T:System.Web.HttpException">Redirection was attempted after the HTTP headers had been sent.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/892441af-8f1d-483e-ab5f-b82c23576f5a">ASP.NET Routing</related>
</Docs>
</Member>
<Member MemberName="RedirectToRoute">
<MemberSignature Language="C#" Value="public void RedirectToRoute (string routeName, object routeValues);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RedirectToRoute(string routeName, object routeValues) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.RedirectToRoute(System.String,System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Sub RedirectToRoute (routeName As String, routeValues As Object)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void RedirectToRoute(System::String ^ routeName, System::Object ^ routeValues);" />
<MemberSignature Language="F#" Value="member this.RedirectToRoute : string * obj -&gt; unit" Usage="httpResponse.RedirectToRoute (routeName, routeValues)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="routeName" Type="System.String" Index="0" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="routeValues" Type="System.Object" Index="1" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="routeName">The name of the route.</param>
<param name="routeValues">The route parameter values.</param>
<summary>Redirects a request to a new URL by using route parameter values and a route name.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is provided for coding convenience. It is equivalent to calling the <xref:System.Web.HttpResponse.Redirect%28System.String%2CSystem.Boolean%29> method with the second parameter set to `false`.
This method converts the object that is passed in `routeValues` to a <xref:System.Web.Routing.RouteValueDictionary?displayProperty=nameWithType> object by using the <xref:System.Web.Routing.RouteValueDictionary.%23ctor%28System.Object%29?displayProperty=nameWithType> constructor. The <xref:System.Web.Routing.RouteCollection.GetVirtualPath%2A?displayProperty=nameWithType> method is then called to determine the URL.
ASP.NET performs the redirection by returning a 302 HTTP status code.
## Examples
The following example shows how to call this method to redirect to a route that is named `Product` and that has parameters that are named `productid` and `category`.
```vb
Response.RedirectToRoute("Product",
New With {.productid = "1", .category = "widgets"})
```
```csharp
Response.RedirectToRoute("Product",
new { productid = "1", category = "widgets" });
```
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">No route corresponds to the specified route parameters.</exception>
<exception cref="T:System.Web.HttpException">Redirection was attempted after the HTTP headers had been sent.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/892441af-8f1d-483e-ab5f-b82c23576f5a">ASP.NET Routing</related>
</Docs>
</Member>
<Member MemberName="RedirectToRoute">
<MemberSignature Language="C#" Value="public void RedirectToRoute (string routeName, System.Web.Routing.RouteValueDictionary routeValues);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RedirectToRoute(string routeName, class System.Web.Routing.RouteValueDictionary routeValues) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.RedirectToRoute(System.String,System.Web.Routing.RouteValueDictionary)" />
<MemberSignature Language="VB.NET" Value="Public Sub RedirectToRoute (routeName As String, routeValues As RouteValueDictionary)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void RedirectToRoute(System::String ^ routeName, System::Web::Routing::RouteValueDictionary ^ routeValues);" />
<MemberSignature Language="F#" Value="member this.RedirectToRoute : string * System.Web.Routing.RouteValueDictionary -&gt; unit" Usage="httpResponse.RedirectToRoute (routeName, routeValues)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="routeName" Type="System.String" Index="0" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="routeValues" Type="System.Web.Routing.RouteValueDictionary" Index="1" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="routeName">The name of the route.</param>
<param name="routeValues">The route parameter values.</param>
<summary>Redirects a request to a new URL by using route parameter values and a route name.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is provided for coding convenience. It is equivalent to calling the <xref:System.Web.HttpResponse.Redirect%28System.String%2CSystem.Boolean%29> method with the second parameter set to `false`.
The <xref:System.Web.Routing.RouteCollection.GetVirtualPath%2A?displayProperty=nameWithType> method is called to determine the URL.
ASP.NET performs the redirection by returning a 302 HTTP status code.
## Examples
The following example shows how to call this method to redirect to a route that is named `Product` and that has parameters that are named `productid` and `category`.
```vb
Response.RedirectToRoute("Product",
new RouteValueDictionary {productId="1", category="widgets"})
```
```csharp
Response.RedirectToRoute("Product",
(new RouteValueDictionary {productId="1", category="widgets"});
```
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">No route corresponds to the specified route parameters.</exception>
<exception cref="T:System.Web.HttpException">Redirection was attempted after the HTTP headers had been sent.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/892441af-8f1d-483e-ab5f-b82c23576f5a">ASP.NET Routing</related>
</Docs>
</Member>
<MemberGroup MemberName="RedirectToRoutePermanent">
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Performs a permanent redirection from a requested URL to a new URL by using route parameter values, a route name, or both.</summary>
</Docs>
</MemberGroup>
<Member MemberName="RedirectToRoutePermanent">
<MemberSignature Language="C#" Value="public void RedirectToRoutePermanent (object routeValues);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RedirectToRoutePermanent(object routeValues) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.RedirectToRoutePermanent(System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Sub RedirectToRoutePermanent (routeValues As Object)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void RedirectToRoutePermanent(System::Object ^ routeValues);" />
<MemberSignature Language="F#" Value="member this.RedirectToRoutePermanent : obj -&gt; unit" Usage="httpResponse.RedirectToRoutePermanent routeValues" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="routeValues" Type="System.Object" Index="0" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="routeValues">The route parameter values.</param>
<summary>Performs a permanent redirection from a requested URL to a new URL by using route parameter values.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is provided for coding convenience. It is equivalent to calling the <xref:System.Web.HttpResponse.RedirectPermanent%28System.String%2CSystem.Boolean%29> method with the second parameter set to `false`.
This method converts the object that is passed in `routeValues` to a <xref:System.Web.Routing.RouteValueDictionary?displayProperty=nameWithType> object by using the <xref:System.Web.Routing.RouteValueDictionary.%23ctor%28System.Object%29?displayProperty=nameWithType> constructor. The <xref:System.Web.Routing.RouteCollection.GetVirtualPath%2A?displayProperty=nameWithType> method is then called to determine the URL.
ASP.NET performs the redirection by returning a 301 HTTP status code.
## Examples
The following example shows how to call this method to redirect to a route that has parameters that are named `productid` and `category`.
```vb
Response.RedirectToRoutePermanent(
New With {.productid = "1", .category = "widgets"})
```
```csharp
Response.RedirectToRoutePermanent(
new { productid = "1", category = "widgets" });
```
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">No route corresponds to the specified route parameters.</exception>
<exception cref="T:System.Web.HttpException">Redirection was attempted after the HTTP headers had been sent.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/892441af-8f1d-483e-ab5f-b82c23576f5a">ASP.NET Routing</related>
</Docs>
</Member>
<Member MemberName="RedirectToRoutePermanent">
<MemberSignature Language="C#" Value="public void RedirectToRoutePermanent (string routeName);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RedirectToRoutePermanent(string routeName) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.RedirectToRoutePermanent(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub RedirectToRoutePermanent (routeName As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void RedirectToRoutePermanent(System::String ^ routeName);" />
<MemberSignature Language="F#" Value="member this.RedirectToRoutePermanent : string -&gt; unit" Usage="httpResponse.RedirectToRoutePermanent routeName" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="routeName" Type="System.String" Index="0" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="routeName">The name of the route.</param>
<summary>Performs a permanent redirection from a requested URL to a new URL by using a route name.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is provided for coding convenience. It is equivalent to calling the <xref:System.Web.HttpResponse.RedirectPermanent%28System.String%2CSystem.Boolean%29> method with the second parameter set to `false`.
This method converts the route name that is passed in `routeName` to a URL by using the <xref:System.Web.Routing.RouteCollection.GetVirtualPath%2A?displayProperty=nameWithType> method.
ASP.NET performs the redirection by returning a 301 HTTP status code.
## Examples
The following example shows how to call this method to redirect to a route that is named `Products`.
```vb
Response.RedirectToRoutePermanent("Products")
```
```csharp
Response.RedirectToRoutePermanent("Products");
```
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">No route corresponds to the specified route parameters.</exception>
<exception cref="T:System.Web.HttpException">Redirection was attempted after the HTTP headers had been sent.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/892441af-8f1d-483e-ab5f-b82c23576f5a">ASP.NET Routing</related>
</Docs>
</Member>
<Member MemberName="RedirectToRoutePermanent">
<MemberSignature Language="C#" Value="public void RedirectToRoutePermanent (System.Web.Routing.RouteValueDictionary routeValues);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RedirectToRoutePermanent(class System.Web.Routing.RouteValueDictionary routeValues) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.RedirectToRoutePermanent(System.Web.Routing.RouteValueDictionary)" />
<MemberSignature Language="VB.NET" Value="Public Sub RedirectToRoutePermanent (routeValues As RouteValueDictionary)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void RedirectToRoutePermanent(System::Web::Routing::RouteValueDictionary ^ routeValues);" />
<MemberSignature Language="F#" Value="member this.RedirectToRoutePermanent : System.Web.Routing.RouteValueDictionary -&gt; unit" Usage="httpResponse.RedirectToRoutePermanent routeValues" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="routeValues" Type="System.Web.Routing.RouteValueDictionary" Index="0" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="routeValues">The route parameter values.</param>
<summary>Performs a permanent redirection from a requested URL to a new URL by using route parameter values.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is provided for coding convenience. It is equivalent to calling the <xref:System.Web.HttpResponse.Redirect%28System.String%2CSystem.Boolean%29> method with the second parameter set to `false`.
This method calls the <xref:System.Web.Routing.RouteCollection.GetVirtualPath%2A?displayProperty=nameWithType> method to determine the URL.
ASP.NET performs the redirection by returning a 301 HTTP status code.
## Examples
The following example shows how to call this method to redirect to a route that has parameters that are named `productid` and `category`.
```vb
Response.RedirectToRoutePermanent(
new RouteValueDictionary {productId="1", category="widgets"})
```
```csharp
Response.RedirectToRoutePermanent(
new RouteValueDictionary {productId="1", category="widgets"});
```
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">No route corresponds to the specified route parameters.</exception>
<exception cref="T:System.Web.HttpException">Redirection was attempted after the HTTP headers had been sent.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/892441af-8f1d-483e-ab5f-b82c23576f5a">ASP.NET Routing</related>
</Docs>
</Member>
<Member MemberName="RedirectToRoutePermanent">
<MemberSignature Language="C#" Value="public void RedirectToRoutePermanent (string routeName, object routeValues);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RedirectToRoutePermanent(string routeName, object routeValues) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.RedirectToRoutePermanent(System.String,System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Sub RedirectToRoutePermanent (routeName As String, routeValues As Object)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void RedirectToRoutePermanent(System::String ^ routeName, System::Object ^ routeValues);" />
<MemberSignature Language="F#" Value="member this.RedirectToRoutePermanent : string * obj -&gt; unit" Usage="httpResponse.RedirectToRoutePermanent (routeName, routeValues)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="routeName" Type="System.String" Index="0" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="routeValues" Type="System.Object" Index="1" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="routeName">The name of the route.</param>
<param name="routeValues">The route parameter values.</param>
<summary>Performs a permanent redirection from a requested URL to a new URL by using the route parameter values and the name of the route that correspond to the new URL.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is provided for coding convenience. It is equivalent to calling the <xref:System.Web.HttpResponse.RedirectPermanent%2A> method with the second parameter set to `false`.
This method converts the object that is passed in `routeValues` to a <xref:System.Web.Routing.RouteValueDictionary?displayProperty=nameWithType> object by using the <xref:System.Web.Routing.RouteValueDictionary.%23ctor%28System.Object%29?displayProperty=nameWithType> constructor. The <xref:System.Web.Routing.RouteCollection.GetVirtualPath%2A?displayProperty=nameWithType> method is then called to determine the URL.
ASP.NET performs the redirection by returning a 301 HTTP status code.
## Examples
The following example shows how to call this method to redirect to a route that is named `Product` and that has parameters that are named `productid` and `category`.
```vb
Response.RedirectToRoutePermanent("Product",
New With {.productid = "1", .category = "widgets"})
```
```csharp
Response.RedirectToRoutePermanent("Product",
new { productid = "1", category = "widgets" });
```
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">No route corresponds to the specified route parameters.</exception>
<exception cref="T:System.Web.HttpException">Redirection was attempted after the HTTP headers had been sent.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/892441af-8f1d-483e-ab5f-b82c23576f5a">ASP.NET Routing</related>
</Docs>
</Member>
<Member MemberName="RedirectToRoutePermanent">
<MemberSignature Language="C#" Value="public void RedirectToRoutePermanent (string routeName, System.Web.Routing.RouteValueDictionary routeValues);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RedirectToRoutePermanent(string routeName, class System.Web.Routing.RouteValueDictionary routeValues) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.RedirectToRoutePermanent(System.String,System.Web.Routing.RouteValueDictionary)" />
<MemberSignature Language="VB.NET" Value="Public Sub RedirectToRoutePermanent (routeName As String, routeValues As RouteValueDictionary)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void RedirectToRoutePermanent(System::String ^ routeName, System::Web::Routing::RouteValueDictionary ^ routeValues);" />
<MemberSignature Language="F#" Value="member this.RedirectToRoutePermanent : string * System.Web.Routing.RouteValueDictionary -&gt; unit" Usage="httpResponse.RedirectToRoutePermanent (routeName, routeValues)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="routeName" Type="System.String" Index="0" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="routeValues" Type="System.Web.Routing.RouteValueDictionary" Index="1" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="routeName">The name of the route.</param>
<param name="routeValues">The route parameter values.</param>
<summary>Performs a permanent redirection from a requested URL to a new URL by using route parameter values and a route name.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is provided for coding convenience. It is equivalent to calling the <xref:System.Web.HttpResponse.Redirect%28System.String%2CSystem.Boolean%29> method with the second parameter set to `false`.
This method calls the <xref:System.Web.Routing.RouteCollection.GetVirtualPath%2A?displayProperty=nameWithType> method to determine the URL.
ASP.NET performs the redirection by returning a 301 HTTP status code.
## Examples
The following example shows how to call this method to redirect to a route that is named `Product` and that has parameters that are named `productid` and `category`.
```vb
Response.RedirectToRoutePermanent("Product",
new RouteValueDictionary {productId="1", category="widgets"})
```
```csharp
Response.RedirectToRoutePermanent("Product",
new RouteValueDictionary {productId="1", category="widgets"});
```
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">No route corresponds to the specified route parameters.</exception>
<exception cref="T:System.Web.HttpException">Redirection was attempted after the HTTP headers had been sent.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/892441af-8f1d-483e-ab5f-b82c23576f5a">ASP.NET Routing</related>
</Docs>
</Member>
<MemberGroup MemberName="RemoveOutputCacheItem">
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Removes cached items from the output cache by using the default output-cache provider.</summary>
</Docs>
</MemberGroup>
<Member MemberName="RemoveOutputCacheItem">
<MemberSignature Language="C#" Value="public static void RemoveOutputCacheItem (string path);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void RemoveOutputCacheItem(string path) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.RemoveOutputCacheItem(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Shared Sub RemoveOutputCacheItem (path As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static void RemoveOutputCacheItem(System::String ^ path);" />
<MemberSignature Language="F#" Value="static member RemoveOutputCacheItem : string -&gt; unit" Usage="System.Web.HttpResponse.RemoveOutputCacheItem path" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="path" Type="System.String" />
</Parameters>
<Docs>
<param name="path">The virtual absolute path to the items that are removed from the cache.</param>
<summary>Removes from the cache all cached items that are associated with the default output-cache provider. This method is static.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Call this method to remove output-cache items that are associated with the default output-cache provider. Call the <xref:System.Web.HttpResponse.RemoveOutputCacheItem%2A> method to remove output-cache items that are associated with custom output-cache providers that are specified in the Web site configuration file.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="path" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="path" /> is not an absolute virtual path.</exception>
</Docs>
</Member>
<Member MemberName="RemoveOutputCacheItem">
<MemberSignature Language="C#" Value="public static void RemoveOutputCacheItem (string path, string providerName);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void RemoveOutputCacheItem(string path, string providerName) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpResponse.RemoveOutputCacheItem(System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Shared Sub RemoveOutputCacheItem (path As String, providerName As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static void RemoveOutputCacheItem(System::String ^ path, System::String ^ providerName);" />
<MemberSignature Language="F#" Value="static member RemoveOutputCacheItem : string * string -&gt; unit" Usage="System.Web.HttpResponse.RemoveOutputCacheItem (path, providerName)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="path" Type="System.String" Index="0" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="providerName" Type="System.String" Index="