DynamicControl.HtmlEncode DynamicControl.HtmlEncode DynamicControl.HtmlEncode DynamicControl.HtmlEncode Property

定義

取得或設定值,這個值表示控制項的資料在呈現之前是否進行 HTML 編碼。Gets or sets a value that indicates whether the data for the control is HTML-encoded before rendering.

public:
 property bool HtmlEncode { bool get(); void set(bool value); };
public bool HtmlEncode { get; set; }
member this.HtmlEncode : bool with get, set
Public Property HtmlEncode As Boolean

屬性值

如果控制項的資料在呈現之前進行 HTML 編碼則為 true,否則為 falsetrue if the data for the control is HTML-encoded before rendering; otherwise, false. 預設為 trueThe default is true.

備註

HtmlEncode使用屬性來指定域值是否會在顯示之前, 以 HTML 編碼為其各自的字串表示。Use the HtmlEncode property to specify whether field values are HTML-encoded to their respective string representations before they are displayed.

注意

HTML 編碼的域值有助於防止跨網站腳本攻擊和惡意內容的顯示。HTML-encoding field values helps to prevent cross-site scripting attacks and malicious content from being displayed. 應該盡可能啟用此屬性。This property should be enabled whenever possible. 如需詳細資訊,請參閱 Script Exploits Overview (指令碼攻擊概觀)。For more information, see Script Exploits Overview.

適用於