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

HtmlEditorExtension.GetHtml(String) Method

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

Namespace: DevExpress.Web.Mvc

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

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); 

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetHtml(String) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also