This documentation is archived and is not being maintained.

TemplateControl::ParseControl Method (String)

Parses an input string into a Control object on the Web Forms page or user control.

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

public:
Control^ ParseControl(
	String^ content
)

Parameters

content
Type: System::String

A string that contains a user control.

Return Value

Type: System.Web.UI::Control
The parsed Control.

The content parameter contains a user control, such as you would find in an .ascx file. This string cannot contain any code, because the ParseControl method never causes compilation.

The following code example demonstrates how to create a Button Web server control using the ParseControl method, and then adds the result to the ControlCollection collection of a PlaceHolder Web server control named myPlaceholder.

No code example is currently available or this language may not be supported.

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

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

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Show: