System.Web.UI.WebControls.BoundField.HtmlEncode Property

Gets or sets a value indicating whether field values are HTML-encoded before they are displayed in a System.Web.UI.WebControls.BoundField object.

Syntax

[System.ComponentModel.DefaultValue(true)]
public virtual bool HtmlEncode { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the BoundField.HtmlEncode property to specify whether field values are HTML-encoded to their respective string representations before they are displayed in a System.Web.UI.WebControls.BoundField object. For example, if this property is true, a string value of "<script>" would be rendered as "&lt;script&gt;". If this property is false, the string would be rendered unchanged.

Note:

HTML-encoding field values helps to prevent cross-site scripting attacks and malicious content from being displayed. This property should be enabled whenever possible.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0