RadEditor for ASP.NET

RadEditor Send comments on this topic.
Html Property
See Also  Example
Telerik.WebControls Namespace > RadEditor Class : Html Property


Gets or sets the text content of the RadEditor control inlcuding the HTML markup.   

 

Namespace: Telerik.WebControls
Assembly: RadEditor (in RadEditor.dll)

Syntax

Visual Basic (Declaration) 
Public Property Html As String
Visual Basic (Usage)Copy Code
Dim instance As RadEditor
Dim value As String
 
instance.Html = value
 
value = instance.Html
C# 
public string Html {get; set;}

Return Value

The text content of the RadEditor control including the HTML markup. The default is string.Empty.

Example

This example demonstrates how to set the content of the RadEditor inline and the differences between the Html, Text and the Xhtml properties.

<rade:radeditor id="RadEditor1" runat="server" saveinfile="false" editable="true">
<b>t</b>elerik RadEditor<br>
the best <span style="COLOR: red">html editor</span> in the world
</rade:radeditor>
<asp:button id="btnSave" runat="server" text="Submit" onclick="btnSave_Click" /><br />
Html:<asp:label runat="server" id="LabelHtml"></asp:label><br />
Text:<asp:label runat="server" id="LabelText"></asp:label><br />
Xhtml:<asp:label runat="server" id="LabelXhtml"></asp:label>

Visual BasicCopy Code
Private Sub btnSave_Click(sender As Object, e As System.EventArgs)
    'HtmlEncode the content of the editor to display the HTML tags
    LabelHtml.Text = Server.HtmlEncode(RadEditor1.Html);
    LabelText.Text = Server.HtmlEncode(RadEditor1.Text);
    LabelXhtml.Text = Server.HtmlEncode(RadEditor1.Xhtml);
End Sub
C#Copy Code
private void btnSave_Click(object sender, System.EventArgs e)
{
   
//HtmlEncode the content of the editor to display the HTML tags
   
LabelHtml.Text = Server.HtmlEncode(RadEditor1.Html);
   LabelText.Text = Server.HtmlEncode(RadEditor1.Text);
   LabelXhtml.Text = Server.HtmlEncode(RadEditor1.Xhtml);
}
    

Remarks

The text returned by this property contains HTML markup. If only the text is needed use the Text property.

It is not guaranteed that the HTML markup from this property will be XHTML compliant. If a valid XHTML is needed, use the Xhtml property.

You can also set the text content of the RadEditor inline between its opening and closing tags. In this case setting this property in the code behind will override the inline content.

Requirements

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

See Also