为什么 ValidateInput(False) 不起作用? [英] Why is ValidateInput(False) not working?

查看:28
本文介绍了为什么 ValidateInput(False) 不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将使用 webforms 创建的应用程序转换为使用 vb.net 的 asp.net mvc 框架.我的观点之一有问题.当我提交表单时,我收到了黄色的死亡屏幕,提示从客户端检测到一个潜在危险的 Request.Form 值".我使用 tinymce 作为我的 RTE.我已经设置了视图本身

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"

ValidateRequest="false"

我知道在 MVC 中,从我目前阅读的内容来看,它并不尊重它.所以我也把它放在控制器动作上.我尝试了不同的设置:

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)> _

……还有……

<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?

推荐答案

您确定要发布到的控制器操作是您拥有的属性吗?

Are you sure that the controller action being posted to is the one you have the attributes on?

这篇关于为什么 ValidateInput(False) 不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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