WebPartAuthorizationEventHandler 委托

定义

表示处理 AuthorizeWebPart 对象的 WebPartManager 事件的方法。Represents the method that handles the AuthorizeWebPart event of a WebPartManager object.

public delegate void WebPartAuthorizationEventHandler(System::Object ^ sender, WebPartAuthorizationEventArgs ^ e);
public delegate void WebPartAuthorizationEventHandler(object sender, WebPartAuthorizationEventArgs e);
type WebPartAuthorizationEventHandler = delegate of obj * WebPartAuthorizationEventArgs -> unit
Public Delegate Sub WebPartAuthorizationEventHandler(sender As Object, e As WebPartAuthorizationEventArgs)

参数

sender
Object

事件源。The source of the event.

e
WebPartAuthorizationEventArgs

包含事件数据的 WebPartAuthorizationEventArgsA WebPartAuthorizationEventArgs that contains the event data.

继承
WebPartAuthorizationEventHandler

注解

AuthorizeWebPart Web 部件控件添加到 Web 部件区域之前引发该事件。The AuthorizeWebPart event is raised before a Web Parts control is added to a Web Parts zone. 您可以通过自定义处理事件的方式来指定哪些 Web 部件控件可以添加到区域。You can specify which Web Parts controls can be added to a zone by customizing how the event is handled. 引发WebPartAuthorizationEventHandler 事件AuthorizeWebPart时, 将调用委托中指定的方法。The method specified in the WebPartAuthorizationEventHandler delegate is called when an AuthorizeWebPart event is raised.

页面开发人员可以通过将OnAuthorizeWebPart属性添加到页面中的<asp:webpartmanager>元素, 并为属性分配自定义方法名称, 为 Web 部件事件提供自定义处理程序。Page developers can provide custom handlers for Web Parts events by adding an OnAuthorizeWebPart attribute to the <asp:webpartmanager> element in a page, and assigning a custom method name to the attribute. 还可以通过编程方式分配自定义处理程序。A custom handler can also be assigned programmatically. 有关如何订阅事件的详细信息, 请参阅如何:引发和使用事件For more information about how to subscribe to an event, see How to: Raise and Consume Events.

扩展方法

GetMethodInfo(Delegate)

获取指示指定委托表示的方法的对象。Gets an object that represents the method represented by the specified delegate.

适用于