Freigeben über


HttpResponse.SuppressContent Eigenschaft

Definition

Dient zum Abrufen oder Festlegen eines Werts, der angibt, ob HTTP-Inhalte an den Client gesendet werden sollen.

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

Eigenschaftswert

truedie Ausgabe zu unterdrücken; andernfalls . false

Beispiele

Im folgenden Beispiel wird überprüft, ob die IsSecureConnection Eigenschaft auf "false" festgelegt ist. Wenn dies der Fall ist, wird die SuppressContent Eigenschaft auf "true" festgelegt, um zu verhindern, dass die Antwort gesendet wird.

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

Gilt für: