HttpResponse.Clear Metoda

Definice

Vymaže veškerý výstup obsahu z streamu vyrovnávací paměti.

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

Příklady

Následující příklad nastaví ContentType vlastnost odpovědi na image/jpeg, zavolá metodu Clear k odebrání dalšího obsahu, který může být připojen k odpovědi, a potom nastaví BufferOutput vlastnost na true, aby byla dokončená stránka zpracována před odesláním jakéhokoli obsahu do žádajícího klienta.

Úplný příklad najdete v HttpResponse třídě.

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

Poznámky

Metoda Clear nesmažou informace o záhlaví.

Platí pro

Viz také