HttpResponse.BufferOutput 屬性

定義

取得或設定值,指出是否要緩衝輸出並在整個網頁處理完成之後送出。Gets or sets a value indicating whether to buffer output and send it after the complete page is finished processing.

public:
 property bool BufferOutput { bool get(); void set(bool value); };
public bool BufferOutput { get; set; }
member this.BufferOutput : bool with get, set
Public Property BufferOutput As Boolean

屬性值

如果對用戶端的輸出有緩衝,則為 true,否則為 falsetrue if the output to client is buffered; otherwise false. 預設值為 trueThe default is true.

範例

下列範例會將回應的 ContentType 屬性設定為影像/jpeg,並呼叫 Clear 方法來移除可能附加至回應的其他內容,然後將 BufferOutput 屬性設定為 true,以便在將任何內容傳送至要求的用戶端之前,先處理整個頁面。The following example sets the ContentType property for the response to image/jpeg, calls the Clear method to remove other content that might be attached to the response, and then sets the BufferOutput property to true so that the entire page will be processed before any content is sent to the requesting client.

如需完整範例,請參閱 HttpResponse 類別。For a complete example, see the HttpResponse class.

    // Set the page's content type to JPEG files
    // and clears all content output from the buffer stream.
    Response.ContentType = "image/jpeg";
    Response.Clear();

    // Buffer response so that page is sent
    // after processing is complete.
    Response.BufferOutput = true;
' Set the page's content type to JPEG files
' and clears all content output from the buffer stream.
Response.ContentType = "image/jpeg"
Response.Clear()

' Buffer response so that page is sent
' after processing is complete.
Response.BufferOutput = True

適用於