KindEditor富文本编辑器, 从客户端中检测到有潜在危险的 Request.Form 值
生活随笔
收集整理的這篇文章主要介紹了
KindEditor富文本编辑器, 从客户端中检测到有潜在危险的 Request.Form 值
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
在用富文本編輯器時(shí)經(jīng)常會(huì)遇到的問題是asp.net報(bào)的”檢測到有潛在危險(xiǎn)的 Request.Form 值“一般的解法是在aspx頁面 ? page ?標(biāo)簽中加上?validaterequest='false' ?但這樣的話 ? 既不安全
? 也不一定有效,好吧,說說我的解決方法吧, 就是在提交的時(shí)候不讓富文本的內(nèi)容提交,先是把內(nèi)容編碼給到一個(gè)隱藏標(biāo)簽,然后給富文本賦空值。
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="保存設(shè)置" runat="server" OnClick="btnsave_Click" OnClientClick="return AddCheck();" /> View Code?
?
轉(zhuǎn)載于:https://www.cnblogs.com/scien626/p/4427740.html
總結(jié)
以上是生活随笔為你收集整理的KindEditor富文本编辑器, 从客户端中检测到有潜在危险的 Request.Form 值的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: RHEL/CentOS 下安装yum源地
- 下一篇: 组合数学(全排列)+DFS CSU 15