HttpResponse.BufferOutput 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定一個值,指示是否緩衝輸出並在完整頁面處理完成後傳送。
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 如果輸出給用戶端有緩衝;否則 false。 預設值為 true。
範例
以下範例設定 ContentType 回應對圖片/jpeg 的屬性,呼叫 Clear 移除可能附加在回應上的其他內容的方法,然後將該屬性設 BufferOutput 為 true,確保整個頁面在任何內容傳送給請求客戶端前都會被處理完畢。
完整範例請參見該 HttpResponse 類別。
// 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