Control.Context Control.Context Control.Context Control.Context Property

Definizione

Ottiene l'oggetto HttpContext associato al controllo server per la richiesta Web corrente.Gets the HttpContext object associated with the server control for the current Web request.

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

Valore della proprietà

Oggetto HttpContext specificato associato alla richiesta corrente.The specified HttpContext object associated with the current request.

Esempi

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

Commenti

Questa proprietà consente di accedere al HttpContext oggetto per la richiesta Web corrente.This property gives you access to the HttpContext object for the current Web request. L'oggetto fornisce proprietà che accedono i Application, Session, Request, Response e altri oggetti che contengono informazioni sulla richiesta HTTP corrente.The object provides properties that access the Application, Session, Request, Response and other objects that contain information about the current HTTP request. Fornisce inoltre metodi che consentono di ottenere le informazioni di configurazione e di impostare o eliminare gli errori per la richiesta.It also provides methods that allow you to obtain configuration information and set or clear errors for the request.

Si applica a

Vedi anche