This documentation is archived and is not being maintained.

DataListDesigner.GetEmptyDesignTimeHtml Method

Gets the HTML used to represent an empty template-based control at design time.

[Visual Basic]
Overrides Protected Function GetEmptyDesignTimeHtml() As String
[C#]
protected override string GetEmptyDesignTimeHtml();
[C++]
protected: String* GetEmptyDesignTimeHtml();
[JScript]
protected override function GetEmptyDesignTimeHtml() : String;

Return Value

The HTML used to represent an empty template-based control at design time.

Example

[Visual Basic] The following code example overrides the GetEmptyDesignTimeHtml method to display text on the design surface when the DataList.ItemTemplate property has not been set by the user. If the TemplatedControlDesigner.CanEnterTemplateMode property is set to true, a string that describes how to edit templates on the design surface is displayed; otherwise, a string stating that the user must define templates in HTML view is displayed.

[Visual Basic] 
Overrides Protected Function GetEmptyDesignTimeHtml() As String
    Dim emptyText As String
 
    ' Check the CanEnterTemplateMode property to
    ' specify which text to display if the ItemTemplate
    ' does not contain a value. 
    If CanEnterTemplateMode Then
        emptyText = _
         "<b>Either the Enabled property value is false or you need to set the ItemTemplate for this control.<br>Right click and to edit templates.</b>"
    Else
        emptyText = _
         "<b>You cannot edit templates in this view.<br>Switch to HTML view to define the ItemTemplate.</b>"
    End If
    
    Return CreatePlaceHolderDesignTimeHtml(emptyText)
End Function

[C#, C++, JScript] No example is available for C#, C++, or JScript. To view a Visual Basic example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

DataListDesigner Class | DataListDesigner Members | System.Web.UI.Design.WebControls Namespace

Show: