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.

적용 대상

추가 정보