WebPartManager.BeginWebPartEditing(WebPart) Method

Definition

Starts the process of editing a WebPart control.

C#
public virtual void BeginWebPartEditing(System.Web.UI.WebControls.WebParts.WebPart webPart);

Parameters

webPart
WebPart

The control to be edited.

Exceptions

webPart is null.

The current display mode on the page is not EditDisplayMode.

webPart is closed.

-or-

webPart is not part of the Controls collection.

-or -

webPart is equal to the SelectedWebPart control.

Remarks

The BeginWebPartEditing method exists so that the process of editing controls can be done in distinct stages, giving developers more control over the process. The method performs a set of initial checks to ensure that webPart is in a state where it can be edited. If webPart passes all the checks, it is then set as the currently selected control (see the SelectedWebPart property), and the editing process can continue.

Applies to

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also