Control.Context Tulajdonság

Definíció

Lekéri az HttpContext aktuális webkérelem kiszolgálóvezérlőjével társított objektumot.

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

Tulajdonság értéke

Az aktuális kéréshez társított megadott HttpContext objektum.

Attribútumok

Példák

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

Megjegyzések

Ez a tulajdonság hozzáférést biztosít az HttpContext aktuális webes kérelem objektumához. Az objektum olyan tulajdonságokat biztosít, amelyek hozzáférnek a Application, Session, RequestResponse és egyéb objektumokhoz, amelyek információkat tartalmaznak az aktuális HTTP-kérésről. Emellett olyan módszereket is biztosít, amelyek lehetővé teszik a konfigurációs információk beszerzését, valamint a kérés hibáinak beállítását vagy törlését.

A következőre érvényes:

Lásd még