Skip to main content

HtmlEditorExtension.GetHtml(String) Method

Returns the HTML markup specifying a specific HtmlEditor’s content.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v23.2.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public static string GetHtml(
    string name
)

Parameters

Name Type Description
name String

A string value that specifies the HtmlEditor’s name (SettingsBase.Name).

Returns

Type Description
String

A string value specifying the editor’s HTML markup.

Remarks

Note that when you call the GetHtml method, it calls the GetHtml(name, htmlEditingSettings, validationSettings, validationDelegate, isValid) overload method with unspecified default parameters. For instance, the default htmlEditingSettings object (ASPxHtmlEditorSettings) prohibits form elements, IFrames, and scripts, so the GetHtml method returns the HTML markup without these elements.

If you wish to change the default behavior, e.g. to allow scripts, call the overloaded method as follows:

ASPxHtmlEditorHtmlEditingSettings editingSettings = new ASPxHtmlEditorHtmlEditingSettings();
editingSettings.AllowScripts = true;
string htmlString = HtmlEditorExtension.GetHtml("heName", editingSettings); 
See Also