Export (0) Print
Expand All

WebPartManager.SelectedWebPart Property

Gets a reference to a WebPart or other server control that is currently selected for editing or for creating a connection with another control.

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

[BrowsableAttribute(false)]
public WebPart SelectedWebPart { get; }

Property Value

Type: System.Web.UI.WebControls.WebParts.WebPart
A WebPart control that is currently selected for editing or forming a connection.

The SelectedWebPart property returns a reference to a WebPart or other server control that is currently selected for editing or for creating a connection with another control.

The WebPartManager control provides several useful methods and events for handling the process of selecting a control. The SelectedWebPartChanging event occurs just after a control is selected, but before any changes are made. To carry out some actions on the control after it is selected, override the OnSelectedWebPartChanging method. For example, you might want to change the appearance of a control that is selected but has not changed yet, to emphasize visually which control is selected.

The SelectedWebPartChanged event occurs just after the selected control has been changed. To carry out some actions on the control after it has changed, override the OnSelectedWebPartChanged method.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft