System.Web.UI.Design.ControlParser.ParseControl Method

Creates a control from the specified markup using the specified designer host and directives.

Syntax

public static System.Web.UI.Control ParseControl (System.ComponentModel.Design.IDesignerHost designerHost, string controlText, string directives)

Parameters

designerHost
An System.ComponentModel.Design.IDesignerHost instance that is the designer host for the page.
controlText
The text of the HTML markup for the control.
directives
The page directives to include in the code for the control.

Returns

The System.Web.UI.Control that controlText represents.

Remarks

The ControlParser.ParseControl(System.ComponentModel.Design.IDesignerHost, string, string) method accesses the string representing the register directives on the ASP.NET Web page using the services of the designer host. Designer host services are acquired through the WebFormsRootDesigner.ReferenceManager property of the ControlDesigner.RootDesigner object, or if that is not available, the System.Web.UI.Design.IWebFormReferenceManager service.

The ControlParser.ParseControl(System.ComponentModel.Design.IDesignerHost, string, string) method throws an exception if the parser cannot build the control.

Requirements

Namespace: System.Web.UI.Design
Assembly: System.Design (in System.Design.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0