Tab
A newer version of this page is available. Switch to the current version.

ASPxWebControl.EncodeHtml Property

Gets or sets a value that specifies whether the web control's value and element content are rendered as pure HTML, or HTML markers are stripped out.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

[DefaultValue(true)]
public virtual bool EncodeHtml { get; set; }
<DefaultValue(True)>
Public Overridable Property EncodeHtml As Boolean

Property Value

Type Default Description
Boolean

true

true if the HTML code contained within the web control's value and element content are not executed and are converted into the corresponding text for display purposes, false if the web control's value and element content can contain pure HTML code.

Remarks

If the EncodeHtml property is set to true the web control's value and element content that contain HTML code is parsed so that any angle bracket (the characters < and >) of HTML tags is converted to specific symbols (&lt; and &gt;) when the web control renders its value and element content to the page. This allows the HTML code to be represented on the page as text (in the text values of menu items for instance).

If this property is set to false the value and element content that contains HTML tags are not specifically parsed and are rendered as pure HTML markup. This allows the result of the HTML code to be displayed within the control (for instance, as texts of menu items).

NOTE

Refer to the HTML Encoding topic for more information on DevExpress ASP.NET controls encoding.

Examples

The following example illustrates how to use the ASPxWebControl.EncodeHtml property.

<dx:ASPxComboBox runat="server" Caption="<b>Preload mode</b> [<a title='Preload description...' href='javascript:;'>?</a>]" EncodeHtml="false">
    <Items>
        <dx:ListEditItem Text="None" />
        <dx:ListEditItem Text="Metadata" />
        <dx:ListEditItem Text="Auto" />
    </Items>
</dx:ASPxComboBox>
See Also
<