Why is ValidateInput(False) not working?

2019-01-06 12:59发布

I am converting an application I created using webforms to the asp.net mvc framework using vb.net. I have a problem with one of my views. I get the yellow screen of death saying "A potentially dangerous Request.Form value was detected from the client" when I submit my form. I am using tinymce as my RTE. I have set on the view itself

ValidateRequest="false"

I know that in MVC it doesn't respect it on the view from what I've read so far. So I put it on the controller action as well. I have tried different setups:

<ValidateInput(False), AcceptVerbs(HttpVerbs.Post)> _

...and...

<AcceptVerbs(HttpVerbs.Post), ValidateInput(False)> _

...and like this as well...

<ValidateInput(False)> _
<AcceptVerbs(HttpVerbs.Post)> _

Just to see if it made a difference, yet I still get the yellow screen of death. I only want to set it for this view and the specific action in my controller that my post pertains to. Am I missing something?

7条回答
做自己的国王
2楼-- · 2019-01-06 13:41

Please note that these suggestions will not fix the problems caused by a bug that occurs when you have to use [ValidateInput(false)] in combination with a FormCollection.

See: ASP.NET MVC 3 ValidateRequest(false) not working with FormCollection

查看更多
登录 后发表回答