Share via


RazorPage.FlushAsync Method

Definition

Invokes FlushAsync() on Output and Stream.FlushAsync on the response stream, writing out any buffered content to the Body.

public:
 System::Threading::Tasks::Task<Microsoft::AspNetCore::Html::HtmlString ^> ^ FlushAsync();
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Html.HtmlString> FlushAsync ();
member this.FlushAsync : unit -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Html.HtmlString>
Public Function FlushAsync () As Task(Of HtmlString)

Returns

A Task<TResult> that represents the asynchronous flush operation and on completion returns an empty IHtmlContent.

Remarks

The value returned is a token value that allows FlushAsync to work directly in an HTML section. However the value does not represent the rendered content. This method also writes out headers, so any modifications to headers must be done before FlushAsync() is called. For example, call SetAntiforgeryCookieAndHeader() to send antiforgery cookie token and X-Frame-Options header to client before this method flushes headers out.

Applies to