AllowHtmlAttribute 類別

定義

藉由略過屬性的要求驗證,允許要求在模型繫結期間包含 HTML 標記 (強烈建議您讓應用程式明確檢查所有停用要求驗證的模型,以避免指令碼擅用)。

[System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)]
public sealed class AllowHtmlAttribute : Attribute, System.Web.Mvc.IMetadataAware
type AllowHtmlAttribute = class
    inherit Attribute
    interface IMetadataAware
Public NotInheritable Class AllowHtmlAttribute
Inherits Attribute
Implements IMetadataAware
繼承
AllowHtmlAttribute
屬性
實作

建構函式

AllowHtmlAttribute()

初始化 AllowHtmlAttribute 類別的新執行個體。

方法

OnMetadataCreated(ModelMetadata)

這個方法支援 ASP.NET MVC 驗證基礎結構,但不建議直接在程式碼中使用。

適用於