Control.Context Свойство
Определение
Возвращает объект HttpContext, связанный с серверным элементом управления для текущего веб-запроса.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
Значение свойства
Указанный объект HttpContext, связанный с текущим запросом.The specified HttpContext object associated with the current request.
- Атрибуты
Примеры
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
Комментарии
Это свойство предоставляет доступ к объекту HttpContext для текущего веб-запроса.This property gives you access to the HttpContext object for the current Web request. Объект предоставляет свойства, которые обращаются к Application, Session, Request, Response и другим объектам, содержащим сведения о текущем HTTP-запросе.The object provides properties that access the Application, Session, Request, Response and other objects that contain information about the current HTTP request. Он также предоставляет методы, позволяющие получать сведения о конфигурации и задавать или очищать ошибки для запроса.It also provides methods that allow you to obtain configuration information and set or clear errors for the request.