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

Definición

Obtiene el objeto HttpContext asociado al control de servidor para la solicitud Web actual.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

Valor de propiedad

Objeto HttpContext especificado asociado a la solicitud actual.The specified HttpContext object associated with the current request.

Ejemplos

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

Comentarios

Esta propiedad proporciona acceso a la HttpContext objeto para la solicitud Web actual.This property gives you access to the HttpContext object for the current Web request. El objeto proporciona propiedades que tienen acceso a la Application, Session, Request, Response y otros objetos que contienen información sobre la solicitud HTTP actual.The object provides properties that access the Application, Session, Request, Response and other objects that contain information about the current HTTP request. También proporciona métodos que permiten obtener información de configuración y establecer o borrar errores para la solicitud.It also provides methods that allow you to obtain configuration information and set or clear errors for the request.

Se aplica a

Consulte también: