Kindeditor Rich Text editor, detects potentially dangerous request.form values from the client

Source: Internet
Author: User

A common problem when using a rich text editor is the "potentially dangerous Request.Form value detected" by the ASP. The general solution is to add validaterequest= ' false ' to the page tab of the ASPX pages, but that's not safe.

It doesn't have to be effective, okay, let's talk about my solution, which is to not allow rich text content to be submitted at the time of submission, first to encode the content to a hidden tag, and then assign a null value to the rich text.

1Kindeditor.ready (function(K) {2Editor = k.create (' #txtIntroduction ', {3 items: [4' Bold ', ' italic ', ' underline ', ' | ', ' insertorderedlist ', ' insertunorderedlist ', ' | ', ' image ', ' | ', ' ForeColor ', ' Hilitecolor ', ' fontname ', ' fontsize ', ' | ', ' source '5                     ],6Uploadjson: '. /.. /scripts/kindeditor/uploadpic.aspx ',7Aftercreate:function () {8                          This. sync ();9                     },TenAfterblur:function () { One                          This. sync (); A                     }, -AfterChange:function () { -                          This. sync (); the                     } -                 }); -             }); -         }); +  -         functionAddcheck () { +$ ("#hdIntroduction"). Val (Escape (Editor.html ())); A$ (' #txtIntroduction '). Val (""); atEditor.html (""); -         } -<asp:button id= "Btnsave" text= "Save Settings" runat= "Server" onclick= "Btnsave_click" onclientclick= "return Addcheck ();"/ >
View Code

  

Kindeditor Rich Text editor, detects potentially dangerous request.form values from the client

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.