Bagikan melalui


HttpResponse.SuppressContent Properti

Definisi

Mendapatkan atau menetapkan nilai yang menunjukkan apakah akan mengirim konten HTTP ke klien.

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

Nilai Properti

true untuk menekan output; jika tidak, false.

Contoh

Contoh berikut memeriksa apakah IsSecureConnection properti diatur ke false. Jika ya, SuppressContent properti diatur ke true untuk menghentikan respons dikirim.

// Check whether the request is sent
// over HTTPS. If not, do not send 
// content to the client.    
if (!Request.IsSecureConnection)
{
    Response.SuppressContent = true;
}
' Check whether the request is sent
' over HTTPS. If not, do not return
' content to the client.
If (Request.IsSecureConnection = False) Then      
    Response.SuppressContent = True
End If

Berlaku untuk