Skip to main content
A newer version of this page is available. .

Get and Set HTML methods, HTML property

The ASPxHtmlEditor‘s content can be specified and obtained, using the following methods and properties:

  • The ASPxClientHtmlEditor.GetHtml client method is used to obtain an HTML markup that represents the editor’s content.

    <dx:ASPxHtmlEditor ID="ASPxHtmlEditor1" runat="server" 
        ClientInstanceName="htmlEditor">
    </dx:ASPxHtmlEditor>
    <br/>
    <dx:ASPxButton ID="ASPxButton1" runat="server" 
        AutoPostBack="False" Text="ASPxButton">
        <ClientSideEvents Click="function(s, e) {
            var myText = htmlEditor.GetHtml();
            myMemo.SetText(myText); 
         }" />
    </dx:ASPxButton>
    <br/>
    <dx:ASPxMemo ID="ASPxMemo1" runat="server" 
        ClientInstanceName="myMemo"  Height="71px" Width="170px">
    </dx:ASPxMemo>
    
  • The ASPxClientHtmlEditor.SetHtml client method is used to specify an HTML markup that represents the editor’s content.

    <dx:ASPxHtmlEditor ID="ASPxHtmlEditor1" runat="server" 
        ClientInstanceName="htmlEditor">
    </dx:ASPxHtmlEditor>
    <br/>
    <dx:ASPxButton ID="ASPxButton1" runat="server" 
        AutoPostBack="False" Text="ASPxButton">
        <ClientSideEvents Click="function(s, e) {
            htmlEditor.SetHtml('Sample Text');
         }" />
    </dx:ASPxButton> 
    
  • The ASPxHtmlEditor.Html property specifies the HTML markup representing the ASPxHtmlEditor’s content.

    <dx:ASPxHtmlEditor ID="ASPxHtmlEditor1" runat="server" 
        ClientInstanceName="htmlEditor"
        Html="&lt;STRONG&gt;Sample Text&lt;/STRONG&gt;" >
    </dx:ASPxHtmlEditor>
    
See Also