Get and Set HTML methods, HTML property
The ASPxHtmlEditor‘s content can be specified and obtained, using the following methods and properties:
The client ASPxClientHtmlEditor.GetHtml 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 client ASPxClientHtmlEditor.SetHtml 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="<STRONG>Sample Text</STRONG>" > </dx:ASPxHtmlEditor>
See Also