.NET Framework Class Library
ControlDesignerGetDesignTimeHtml Method (DesignerRegionCollection)

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 System.Design.dll)
Syntax
Public Overridable Function GetDesignTimeHtml ( _
	regions As [%$TOPIC/39kd6zyt_en-us_VS_110_1_0_0_0_0%] _
) As [%$TOPIC/39kd6zyt_en-us_VS_110_1_0_0_0_1%]
public virtual [%$TOPIC/39kd6zyt_en-us_VS_110_1_0_1_0_0%] GetDesignTimeHtml(
	[%$TOPIC/39kd6zyt_en-us_VS_110_1_0_1_0_1%] regions
)
public:
virtual [%$TOPIC/39kd6zyt_en-us_VS_110_1_0_2_0_0%]^ GetDesignTimeHtml(
	[%$TOPIC/39kd6zyt_en-us_VS_110_1_0_2_0_1%]^ regions
)
abstract GetDesignTimeHtml : 
        regions:[%$TOPIC/39kd6zyt_en-us_VS_110_1_0_3_0_0%] -> [%$TOPIC/39kd6zyt_en-us_VS_110_1_0_3_0_1%]  
override GetDesignTimeHtml : 
        regions:[%$TOPIC/39kd6zyt_en-us_VS_110_1_0_3_0_2%] -> [%$TOPIC/39kd6zyt_en-us_VS_110_1_0_3_0_3%]

Parameters

regions
Type: System.Web.UI.DesignDesignerRegionCollection

A collection of control designer regions for the associated control.

Return Value

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

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.

Examples

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 Overrides Function GetDesignTimeHtml(ByVal regions As DesignerRegionCollection) As String 
    ' Create 3 regions: 2 clickable headers and an editable row
    regions.Add(New DesignerRegion(Me, "Header0"))
    regions.Add(New DesignerRegion(Me, "Header1"))

    ' Create an editable region and add it to the regions 
    Dim editableRegion As EditableDesignerRegion = _
        New EditableDesignerRegion(Me, _
            "Content" & myControl.CurrentView, False)
    regions.Add(editableRegion)

    ' Set the highlight for the selected region
    regions(myControl.CurrentView).Highlight = True 

    ' Use the base class to render the markup 
    Return MyBase.GetDesignTimeHtml()
End Function
// 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);
    regions.Add(editableRegion);

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

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

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0
.NET Framework Security
Platforms

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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