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

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

问题描述

大家好,我有一个MVC应用程序,并且在textarea控件中使用了富文本框控件.我已将页面与模型绑定,并从类属性中获取数据.这是使用文本编辑器的textarea控件.

Hi All, I have a MVC application and I am using a rich text box control in a textarea control. I have bind the page with the Model and fetching the data from the class properties. here is the textarea control to use the Text Editor

<textarea class="rchTxtAr limit-max-char-500" name="txtAddArActResponsibilty" id="txtAddArActResponsibilty"
                    rows="10" cols="90"></textarea



我正在序列化表单,然后发布该表单以保存数据



I am serializing the form and then post the form to save the data

var data = $("#myform").serialize();

$jUnt.ajax({
           url: "/mycontroller/SaveData",
            method: ''post'',
	    type: ''html'',
            data:data,
	    success: function (data) {}
            }); 



当我这样做时,会显示以下错误



When I do this it''s show the following error

A potentially dangerous Request.Form value was detected from the client in...



我还在SaveData操作中设置了[ValidateInput(false)]属性.请您让我知道如何解决此问题吗?



I have also set the [ValidateInput(false)] property in the SaveData action..Would you please let me know how to solve this problem?

推荐答案

(# myform).serialize();
("#myform").serialize();


jUnt.ajax({ 网址:"/mycontroller/SaveData", 方法:发布", 类型:"html", 数据:数据, 成功:功能(数据){} });
jUnt.ajax({ url: "/mycontroller/SaveData", method: ''post'', type: ''html'', data:data, success: function (data) {} });



当我这样做时,会显示以下错误



When I do this it''s show the following error

A potentially dangerous Request.Form value was detected from the client in...



我还在SaveData操作中设置了[ValidateInput(false)]属性.请您让我知道如何解决此问题吗?



I have also set the [ValidateInput(false)] property in the SaveData action..Would you please let me know how to solve this problem?


尝试validateRequest="false"

http://www.asp.net/learn/whitepapers/request-validation [ ^ ]
Try validateRequest="false"

http://www.asp.net/learn/whitepapers/request-validation[^]


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

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