ASP.NET MVC 关闭 客户端 xss 检查
2015-12-15 11:22
585 查看
为防止 XSS 攻击,asp.net 机制 会默认检测 请求报文 内是否有包含html标签,以提醒开发人员处理,报错如下:
[b]"从客户端中检测到有潜在危险的Request...值"[/b]
当我们选择了处理方式后,需要关闭 这个检查,在 MVC 中关闭方式: 为 目标 action方法添加 ValidateInput 特性,如:
[b]"从客户端中检测到有潜在危险的Request...值"[/b]
当我们选择了处理方式后,需要关闭 这个检查,在 MVC 中关闭方式: 为 目标 action方法添加 ValidateInput 特性,如:
1 [ValidateInput(false)] [HttpPost] public ActionResult Modify(Models.Blog model) { //...... }
相关文章推荐
- ASPxPopupControl 关闭刷新
- ASP.NET 获取IP和MAC地址
- GridView的编辑,更新,取消,删除等功能演示
- 25、ASP.NET MVC入门到精通——Spring.net-业务层仓储
- asp.net中三层架构与mvc之区别?
- Asp.net Model binding
- 【ASP.NET】ASP.NET之数据验证控件
- ASP.NET内核几大对象、ASP.NET核心知识(6)--转载
- Encountered an unexpected error when attempting to resolve tag helper directive '@addTagHelper' with value '"*, Microsoft.AspNet.Mvc.TagHelpers"'
- 多个web.config文件按照上面顺序加载
- Windows2008 64位系统asp连接access数据库解决方法
- ASP.NET MVC 的URL路由介绍
- ASP.NET 设置DropDownList的当前选项
- spring AspectJ的Execution表达式
- 理解SVG坐标系和变换:视窗,viewBox和preserveAspectRatio
- ASP.NET MVC 4.0 中使用NPOI 2.2.0 按模板生成Excel报表
- ASP.NET 企业组织机构代码验证
- asp.net后台获取路径的各种方法归纳
- 策略模式,ASP.NET实现
- 树莓派实践部分——P2P文件下载机torrent之Raspberry Pi管理