Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

WebPartManager.OnSelectedWebPartChanged Method

Note: This method is new in the .NET Framework version 2.0.

Raises the SelectedWebPartChanged event, which occurs after a WebPart control has either been newly selected or had its selection cleared.

Namespace: System.Web.UI.WebControls.WebParts
Assembly: System.Web (in system.web.dll)

protected virtual void OnSelectedWebPartChanged (
	WebPartEventArgs e
protected void OnSelectedWebPartChanged (
	WebPartEventArgs e
protected function OnSelectedWebPartChanged (
	e : WebPartEventArgs



A WebPartEventArgs that contains the event data.

The OnSelectedWebPartChanged method raises the SelectedWebPartChanged event, which is typically a point in time where a developer might want to change the appearance of the user interface (UI). For example, when a new WebPart control is selected, the Web Parts control set changes the rendering of the newly selected control. After a control's selection is cleared, the rendering is returned to normal.

After a user selects a particular WebPart control for editing, the OnSelectedWebPartChanged method is called. When the user finishes editing the control and closes it, with the result that the control's selection is cleared, the OnSelectedWebPartChanged method is called again.

Notes to Inheritors There are several options related to the SelectedWebPartChanged event, to allow developers to customize the rendering that occurs after the selected control has changed. In declarative code, within the <asp:webpartmanager> element you could set the OnSelectedWebPartChanged attribute, and assign to it the name of a custom method. In the custom method, you could modify the rendering of the selected controls when the event occurs. Another option is to inherit from the WebPartManager class and override the method. A third option is to customize the rendering at the zone level; for example, you can inherit from the EditorZoneBase class, and override its OnSelectedWebPartChanged method, to customize the rendering of controls selected and cleared during the editing process.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.