LoginViewDesigner.GetDesignTimeHtml Method

Definition

Gets the markup that is used to render the associated LoginView control at design time.

Overloads

GetDesignTimeHtml()

Gets the markup that is used to render the associated control at design time.

GetDesignTimeHtml(DesignerRegionCollection)

Gets the markup that is used to render the associated control at design time and populates a collection of designer regions.

GetDesignTimeHtml()

Gets the markup that is used to render the associated control at design time.

public:
 override System::String ^ GetDesignTimeHtml();
public override string GetDesignTimeHtml ();
override this.GetDesignTimeHtml : unit -> string
Public Overrides Function GetDesignTimeHtml () As String

Returns

A string containing the markup used to render the LoginView at design time.

Examples

The following code example shows how to override the GetDesignTimeHtml method in a class that is inherited from the LoginViewDesigner class to change the appearance of a control that is derived from the LoginView class at design time. The example draws an orange border around the control to make its extent more visible.

// Generate the design-time markup.
public override string GetDesignTimeHtml(DesignerRegionCollection regions)
{
    // Make the control more visible in the designer.   
    // Enclose the markup in a table with an orange border. 
    const string openTableMarkup =
        "<table><tr><td style=\"border:4 solid #FF7F00;\">";
    const string closeTableMarkup = "</td></tr></table>";

    // Call the base method to generate the markup.
    string markup = base.GetDesignTimeHtml(regions);

    return openTableMarkup + markup + closeTableMarkup;
} // GetDesignTimeHtml
' Generate the design-time markup.
Public Overrides Function GetDesignTimeHtml( _
    ByVal regions As DesignerRegionCollection) As String

    ' Make the control more visible in the designer.  
    ' Enclose the markup in a table with an orange border. 
    Dim openTableMarkup As String = _
        "<table><tr><td style=""border:4 solid #FF7F00;"">"
    Dim closeTableMarkup As String = "</td></tr></table>"

    ' Call the base method to generate the markup.
    Dim markup As String = MyBase.GetDesignTimeHtml(regions)

    Return openTableMarkup & markup & closeTableMarkup

End Function ' GetDesignTimeHtml

Remarks

The GetDesignTimeHtml method sets the template index of the associated LoginView control to the current design-time index, and then causes the associated control to recreate and data bind its child controls, if necessary. Next, the GetDesignTimeHtml calls the GetDesignTimeHtml base method to generate the markup.

Notes to Inheritors

If you override the GetDesignTimeHtml() method, be sure to call the GetDesignTimeHtml() base method because it eventually, through several override levels, calls on the LoginView control or a copy of the control to generate the markup.

See also

Applies to

GetDesignTimeHtml(DesignerRegionCollection)

Gets the markup that is used to render the associated control at design time and populates a collection of designer regions.

public:
 override System::String ^ GetDesignTimeHtml(System::Web::UI::Design::DesignerRegionCollection ^ regions);
public override string GetDesignTimeHtml (System.Web.UI.Design.DesignerRegionCollection regions);
override this.GetDesignTimeHtml : System.Web.UI.Design.DesignerRegionCollection -> string
Public Overrides Function GetDesignTimeHtml (regions As DesignerRegionCollection) As String

Parameters

regions
DesignerRegionCollection

A DesignerRegionCollection to which definitions of the selectable and clickable regions in the design-time view of the LoginView are added.

Returns

A string containing the markup used to render the LoginView at design time.

Examples

The following code example shows how to override the GetDesignTimeHtml method in a class that is inherited from the LoginViewDesigner class to change the appearance of a control that is derived from the LoginView class at design time. The example draws an orange border around the control to make its extent more visible.

// Generate the design-time markup.
public override string GetDesignTimeHtml(DesignerRegionCollection regions)
{
    // Make the control more visible in the designer.   
    // Enclose the markup in a table with an orange border. 
    const string openTableMarkup =
        "<table><tr><td style=\"border:4 solid #FF7F00;\">";
    const string closeTableMarkup = "</td></tr></table>";

    // Call the base method to generate the markup.
    string markup = base.GetDesignTimeHtml(regions);

    return openTableMarkup + markup + closeTableMarkup;
} // GetDesignTimeHtml
' Generate the design-time markup.
Public Overrides Function GetDesignTimeHtml( _
    ByVal regions As DesignerRegionCollection) As String

    ' Make the control more visible in the designer.  
    ' Enclose the markup in a table with an orange border. 
    Dim openTableMarkup As String = _
        "<table><tr><td style=""border:4 solid #FF7F00;"">"
    Dim closeTableMarkup As String = "</td></tr></table>"

    ' Call the base method to generate the markup.
    Dim markup As String = MyBase.GetDesignTimeHtml(regions)

    Return openTableMarkup & markup & closeTableMarkup

End Function ' GetDesignTimeHtml

Remarks

The GetDesignTimeHtml method creates an EditableDesignerRegion object for a template editing area on the visual designer surface, and then initializes it as a template. If no templates are defined, a string is displayed that prompts you to click to begin editing. A predefined constant is used to generate the returned markup.

Notes to Inheritors

This GetDesignTimeHtml(DesignerRegionCollection) overload does not call on its base method or the LoginView control to generate the markup.

See also

Applies to