ConnectionsZone.OnDisplayModeChanged(Object, WebPartDisplayModeEventArgs) 方法
定义
引发 DisplayModeChanged 事件。Raises the DisplayModeChanged event.
protected:
override void OnDisplayModeChanged(System::Object ^ sender, System::Web::UI::WebControls::WebParts::WebPartDisplayModeEventArgs ^ e);
protected override void OnDisplayModeChanged (object sender, System.Web.UI.WebControls.WebParts.WebPartDisplayModeEventArgs e);
override this.OnDisplayModeChanged : obj * System.Web.UI.WebControls.WebParts.WebPartDisplayModeEventArgs -> unit
Protected Overrides Sub OnDisplayModeChanged (sender As Object, e As WebPartDisplayModeEventArgs)
参数
- sender
- Object
事件的发送方。The sender of the event.
包含事件数据的 WebPartDisplayModeEventArgs。A WebPartDisplayModeEventArgs that contains the event data.
注解
此方法引发 DisplayModeChanged 事件,并为其提供自定义处理程序。This method raises the DisplayModeChanged event and provides a custom handler for it. 网页进入或退出连接显示模式后,此方法将执行控件的唯一几个步骤 ConnectionsZone 。After a Web page enters or exits the connect display mode, this method carries out several steps unique to the ConnectionsZone control. 此方法会取消任何挂起的连接活动,以确保通过将属性设置为,以确保不会显示连接用户界面 (UI) 的子控件 ChildControlsCreated false ,并将连接用户界面设置为在用户继续创建连接的过程中可以显示有关现有连接的信息的模式。The method cancels any connection activity that is pending at this point, ensures that no child controls from the connection user interface (UI) are displayed by setting the ChildControlsCreated property to false, and sets the connection UI to a mode in which it can display information about existing connections, if a user proceeds with the process of creating a connection.
若要向方法中提供的处理添加专用处理 OnDisplayModeChanged ,开发人员可从 ConnectionsZone 类继承并重写此方法。To add specialized handling to the handling provided in the OnDisplayModeChanged method, developers can inherit from the ConnectionsZone class and override this method. 作为替代方法,开发人员还可以 DisplayModeChanged WebPartManager 通过将 OnDisplayModeChanged 特性添加到网页 <asp:webpartmanager> 中的元素并向其分配用于处理事件的自定义方法的值,为控件上的事件提供处理程序。As an alternative, developers can also provide a handler for the DisplayModeChanged event on the WebPartManager control by adding an OnDisplayModeChanged attribute to the <asp:webpartmanager> element in a Web page, and assigning to it the value of a custom method to handle the event. 在此方法中,开发人员可以检查属性的当前值 DisplayMode ,如果是,则 ConnectDisplayMode 可以对控件执行所需的更改 ConnectionsZone 。In this method, developers can check the current value of the DisplayMode property, and if it is ConnectDisplayMode, they can carry out the desired changes to the ConnectionsZone control.