KindEditor富文本编辑器, 从客户端中检测到有潜在危险的 Request.Form 值
生活随笔
收集整理的這篇文章主要介紹了
KindEditor富文本编辑器, 从客户端中检测到有潜在危险的 Request.Form 值
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在用富文本編輯器時經常會遇到的問題是asp.net報的”檢測到有潛在危險的 Request.Form 值“一般的解法是在aspx頁面 ? page ?標簽中加上?validaterequest='false' ?但這樣的話 ? 既不安全
? 也不一定有效,好吧,說說我的解決方法吧, 就是在提交的時候不讓富文本的內容提交,先是把內容編碼給到一個隱藏標簽,然后給富文本賦空值。
1 KindEditor.ready(function (K) { 2 Editor = K.create('#txtIntroduction', { 3 items: [ 4 'bold', 'italic', 'underline', '|', 'insertorderedlist', 'insertunorderedlist', '|', 'image', '|', 'forecolor', 'hilitecolor', 'fontname', 'fontsize', '|', 'source' 5 ], 6 uploadJson: '../../Scripts/kindeditor/uploadpic.aspx', 7 afterCreate: function () { 8 this.sync(); 9 }, 10 afterBlur: function () { 11 this.sync(); 12 }, 13 afterChange: function () { 14 this.sync(); 15 } 16 }); 17 }); 18 }); 19 20 function AddCheck() { 21 $("#hdIntroduction").val(escape(Editor.html())); 22 $('#txtIntroduction').val(""); 23 Editor.html(""); 24 } 25 <asp:Button ID="btnsave" Text="保存設置" runat="server" OnClick="btnsave_Click" OnClientClick="return AddCheck();" /> View Code?
?
轉載于:https://www.cnblogs.com/scien626/p/4427740.html
總結
以上是生活随笔為你收集整理的KindEditor富文本编辑器, 从客户端中检测到有潜在危险的 Request.Form 值的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: RHEL/CentOS 下安装yum源地
- 下一篇: 十八年前漏洞再现,影响所有Windows