从客户端检测到有潜在危险的Request.Form值 - ASP.NET MVC [英] A potentially dangerous Request.Form value was detected from the client - ASP.NET MVC

查看:84
本文介绍了从客户端检测到有潜在危险的Request.Form值 - ASP.NET MVC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我正在从所见即所得的HTML的输入,所以我不想要的内容验证做我的ASP.NET MVC应用程序收到此错误。

I am getting this error in my ASP.NET MVC application where I am taking HTML input from a WYSIWYG so I don't want the content validated.

我试图找到我的解决方案,<一个href=\"http://stackoverflow.com/questions/81991/a-potentially-dangerous-request-form-value-was-detected-from-the-client\">here但它似乎使我的MVC应用程序没有区别。我自己也尝试做在web.config却又 - 没有喜悦。这是ASP.NET MVC或错误的东西吗?

I have attempted the solution I found here but it seems to make no difference in my MVC application. I have also tried doing it in the web.config but again - no joy. Is this a bug in ASP.NET MVC or something?

推荐答案

在MVC中,你会使用ValidateInput(false)属性。

In MVC you would use the ValidateInput(false) attribute.

您接着需要净化你的输入,例如与像这个

You then need to sanitize your inputs, e.g. with something like this.

这篇关于从客户端检测到有潜在危险的Request.Form值 - ASP.NET MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆