HttpResponse.Clear Metod

Definition

Rensar alla innehållsutdata från buffertströmmen.

public:
 void Clear();
public void Clear();
member this.Clear : unit -> unit
Public Sub Clear ()

Exempel

I följande exempel anges ContentType egenskapen för svaret på bild/jpeg, anropar Clear metoden för att ta bort annat innehåll som kan vara kopplat till svaret och anger BufferOutput sedan egenskapen till true så att hela sidan bearbetas innan innehåll skickas till den begärande klienten.

Ett fullständigt exempel finns i HttpResponse klassen .

    // 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

Kommentarer

Metoden Clear rensar inte rubrikinformation.

Gäller för

Se även