ControlDesigner.GetDesignTimeHtml Method (DesignerRegionCollection)

Note: This method is new in the .NET Framework version 2.0.

Retrieves the HTML markup to display the control and populates the collection with the current control designer regions.

Namespace: System.Web.UI.Design
Assembly: System.Design (in

public virtual string GetDesignTimeHtml (
	DesignerRegionCollection regions
public String GetDesignTimeHtml (
	DesignerRegionCollection regions
public function GetDesignTimeHtml (
	regions : DesignerRegionCollection
) : String



A collection of control designer regions for the associated control.

Return Value

The design-time HTML markup for the associated control, including all control designer regions.

The design host calls the GetDesignTimeHtml method to get the design-time HTML markup and the current list of control designer regions. Using the DesignerRegionCollection, the design host can then request the markup for each editable control designer region.

The GetDesignTimeHtml method is provided for a derived control designer, such as the GridViewDesigner class, that must process the content for the region before calling the GetDesignTimeHtml method.

The following code example shows how to create HTML markup using the DesignerRegionCollection collection.

// Create the regions and design-time markup. Called by the designer host.
public override String GetDesignTimeHtml(DesignerRegionCollection regions) {
    // Create 3 regions: 2 clickable headers and an editable row
    regions.Add(new DesignerRegion(this, "Header0"));
    regions.Add(new DesignerRegion(this, "Header1"));

    // Create an editable region and add it to the regions
    EditableDesignerRegion editableRegion = 
        new EditableDesignerRegion(this, 
            "Content" + myControl.CurrentView, false);

    // Set the highlight for the selected region
    regions[myControl.CurrentView].Highlight = true;

    // Use the base class to render the markup
    return base.GetDesignTimeHtml();

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0