HttpContext.Handler 属性


获取或设置负责处理 HTTP 请求的 IHttpHandler 对象。Gets or sets the IHttpHandler object responsible for processing the HTTP request.

 property System::Web::IHttpHandler ^ Handler { System::Web::IHttpHandler ^ get(); void set(System::Web::IHttpHandler ^ value); };
public System.Web.IHttpHandler Handler { get; set; }
member this.Handler : System.Web.IHttpHandler with get, set
Public Property Handler As IHttpHandler



负责处理 HTTP 请求的 IHttpHandlerAn IHttpHandler responsible for processing the HTTP request.


Handler属性包含对处理 HTTP 请求的处理程序的引用。The Handler property contains a reference to the handler that processes the HTTP request. 可以使用 httpHandlers 元素或在用户代码中定义的自定义处理程序来指定处理程序。The handler can be specified by using the httpHandlers element, or by using a custom handler defined in user code. 有关处理程序的详细信息,请参阅 Http 处理程序和 Http 模块概述For more information about handlers, see HTTP Handlers and HTTP Modules Overview.

Handler即使在服务器端方法(如 Execute 方法或方法)更改了当前页后,对属性的引用也将保持不变 TransferThe reference to the Handler property will remain the same even after the current page has been changed by a server-side method, such as the Execute method or the Transfer method.