Control.Context 속성

정의

현재 웹 요청에 대한 서버 컨트롤과 관련된 HttpContext 개체를 가져옵니다.

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

속성 값

HttpContext

현재 요청과 관련하여 지정된 HttpContext 개체입니다.

특성

예제

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 있습니다. 개체는 현재 HTTP 요청에 대한 정보를 포함하는 , RequestSessionResponse 및 기타 개체에 액세스Application하는 속성을 제공합니다. 또한 구성 정보를 가져오고 요청에 대한 오류를 설정하거나 지울 수 있는 메서드를 제공합니다.

적용 대상

추가 정보