Sdílet prostřednictvím


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 pro odpověď na image/jpeg, volá metodu Clear pro odebrání dalšího obsahu, který může být připojen k odpovědi, a potom nastaví BufferOutput vlastnost na true, aby byla kompletní 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 nesmazat informace hlavičky.

Platí pro

Viz také