Control.Context Właściwość
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
HttpContext Pobiera obiekt skojarzony z kontrolką serwera dla bieżącego żądania sieci Web.
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
Określony HttpContext obiekt skojarzony z bieżącym żądaniem.
- Atrybuty
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
Ta właściwość zapewnia dostęp do HttpContext obiektu dla bieżącego żądania sieci Web. Obiekt udostępnia właściwości, które uzyskują dostęp do Applicationobiektów , , SessionRequestResponse i, które zawierają informacje o bieżącym żądaniu HTTP. Udostępnia również metody, które umożliwiają uzyskiwanie informacji o konfiguracji i ustawianie lub czyszczenie błędów dla żądania.
Produkt | Wersje |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 |