首页 新闻 会员 周边

.net 使用Ueditor ,提交时提示,检测到有潜在危险的 Request.Form 值?

0
悬赏园豆:20 [已解决问题] 解决于 2014-09-04 17:22

百度Ueditor编辑器 ,能成功调出,但是在提交时,提示“从客户端(editorValue="<p>欢迎使用ueditor!</p>")中检测到有潜在危险的 Request.Form 值。

 

 

<%@ Page validateRequest="false" EnableViewStateMac="false"  AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="ueditorDemo._Default" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script src="ueditor/editor_config.js" type="text/javascript"></script>
    <script src="ueditor/editor_all.js" type="text/javascript"></script>
    <link href="ueditor/themes/default/ueditor.css" rel="stylesheet" type="text/css" />

</head>
<body>
 <form id="form1" runat="server" method=post>
   <div id="myEditor" style="width:800px;"></div>
      <script type="text/javascript">
          var editor = new baidu.editor.ui.Editor();
          editor.render("myEditor");
      </script>
    <asp:Button ID="btn_Submit" runat="server" OnClientClick="getValue()"  Text="提交" />
 </form>
</body>
</html>
<script type="text/javascript">
function getValue(){
  var editor =document.GetEmelentById(myEditor);
  var text=editor.getContent();//这是获取控件的内容
}
</script>

我该如何获取编辑器内的内容呢 ?

问题补充:
<?xml version="1.0"?>
<configuration>
    <system.web>
        <compilation debug="true" targetFramework="4.0"/>
    <httpRuntime requestValidationMode="2.0" />
    <pages validateRequest="false" />
    </system.web>
</configuration>

这个已经关闭了请求验证,还是不行啊
天水Lv的主页 天水Lv | 初学一级 | 园豆:41
提问于:2014-09-04 09:57
< >
分享
最佳答案
0

关闭请求验证,请允许我推荐一下:http://www.cnblogs.com/52XF/p/3740333.html

收获园豆:10
晓菜鸟 | 老鸟四级 |园豆:2594 | 2014-09-04 10:45
其他回答(6)
0

关掉请求验证。

收获园豆:5
幻天芒 | 园豆:37175 (高人七级) | 2014-09-04 10:20
0

关闭请求验证

收获园豆:5
aries_gold | 园豆:141 (初学一级) | 2014-09-04 10:32
1

将requestPathInvalidCharacters设置为空试试:

<httpRuntime requestValidationMode="2.0" requestPathInvalidCharacters="" />

参考博文:从客户端(&)中检测到有潜在危险的 Request.Path 值

dudu | 园豆:30994 (高人七级) | 2014-09-04 11:55
0

Action头上添加 [ValidateInput(false)]   的标识

悟行 | 园豆:12559 (专家六级) | 2014-09-04 13:10

Action头上添加 [ValidateInput(false)]   的标识

具体怎么加?

支持(0) 反对(0) 天水Lv | 园豆:41 (初学一级) | 2014-09-04 16:38

@天水Lv: 

[ValidateInput(false)]

public ActionResult Index(XDocument xml){

 

}

支持(0) 反对(1) 悟行 | 园豆:12559 (专家六级) | 2014-09-04 16:41
0

dfd

DC2014 | 园豆:202 (菜鸟二级) | 2014-12-03 15:50
1

两种方式:1、如上楼,修改web.config和页面的ValidateRequest

2、在提交后台的时候,对提交的数据进行编码处理;

异次元代码 | 园豆:101 (初学一级) | 2015-11-04 15:56
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册