Control.Context Eigenschaft

Definition

Ruft das Objekt ab, das HttpContext dem Serversteuerelement für die aktuelle Webanforderung zugeordnet ist.

protected:
 virtual property System::Web::HttpContext ^ Context { System::Web::HttpContext ^ get(); };
protected public:
 virtual property System::Web::HttpContext ^ Context { System::Web::HttpContext ^ get(); };
[System.ComponentModel.Browsable(false)]
protected virtual System.Web.HttpContext Context { get; }
[System.ComponentModel.Browsable(false)]
protected internal virtual System.Web.HttpContext Context { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Context : System.Web.HttpContext
Protected Overridable ReadOnly Property Context As HttpContext
Protected Friend Overridable ReadOnly Property Context As HttpContext

Eigenschaftswert

Das angegebene HttpContext Objekt, das der aktuellen Anforderung zugeordnet ist.

Attribute

Beispiele

protected override bool OnBubbleEvent(object sender, EventArgs e)
{

   // Use the Context property to write text to the TraceContext object
   // associated with the current request.
   Context.Trace.Write("The ParentControl's OnBubbleEvent method is called.");
   Context.Trace.Write("The Source of event is: " + sender.ToString());

   return true;
}
<System.Security.Permissions.PermissionSetAttribute( _
    System.Security.Permissions.SecurityAction.Demand, Name:="FullTrust")> _
Protected Overrides Function OnBubbleEvent(ByVal sender As Object, ByVal e As EventArgs) As Boolean

    ' Use the Context property to write text to the TraceContext object
    ' associated with the current request.         
    Context.Trace.Write("The ParentControl's OnBubbleEvent method is called.")
    Context.Trace.Write("The Source of event is: " + sender.ToString())

    Return True
End Function 'OnBubbleEvent

Hinweise

Diese Eigenschaft gewährt Ihnen Zugriff auf das HttpContext Objekt für die aktuelle Webanforderung. Das Objekt stellt Eigenschaften bereit, die auf die Applicationaktuelle ResponseSessionRequestHTTP-Anforderung zugreifen, und andere Objekte, die Informationen zur aktuellen HTTP-Anforderung enthalten. Außerdem werden Methoden bereitgestellt, mit denen Sie Konfigurationsinformationen abrufen und Fehler für die Anforderung festlegen oder löschen können.

Gilt für:

Weitere Informationen