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 验证基础结构,它不应直接在你的代码中使用。

适用于