Edit

Share via


WebFormsRootDesigner.AddControlToDocument Method

Definition

When overridden in a derived class, adds a Web server control to the Web Forms page.

public:
 abstract System::String ^ AddControlToDocument(System::Web::UI::Control ^ newControl, System::Web::UI::Control ^ referenceControl, System::Web::UI::Design::ControlLocation location);
public abstract string AddControlToDocument (System.Web.UI.Control newControl, System.Web.UI.Control referenceControl, System.Web.UI.Design.ControlLocation location);
abstract member AddControlToDocument : System.Web.UI.Control * System.Web.UI.Control * System.Web.UI.Design.ControlLocation -> string
Public MustOverride Function AddControlToDocument (newControl As Control, referenceControl As Control, location As ControlLocation) As String

Parameters

newControl
Control

The control to add to the Web Forms page.

referenceControl
Control

The control relative to which newControl is added.

location
ControlLocation

A ControlLocation value that indicates the location for newControl relative to referenceControl.

Returns

The ID of the control that was added.

Remarks

Although a control might already have an ID assigned to it, if there is already a control in the Web Forms page with the same ID, a new ID is assigned.

Applies to

See also