KindEditor Rich Text Editor, which detects potentially dangerous Request. Form values from the client, and kindeditor Editor

Source: Internet
Author: User

KindEditor Rich Text Editor, which detects potentially dangerous Request. Form values from the client, and kindeditor Editor

When using the rich text editor, the common problem is that asp.net reports detect potentially dangerous requests. the Form value "the general solution is to add validaterequest = 'false' to the aspx page tag, but this is neither safe nor safe.

It may not be effective either. Well, let's talk about my solution, that is, when submitting, we will not allow rich text content to be submitted. First, we will encode the content to a hidden tag, then assign a null value to the rich text.

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 = "Save settings" runat = "server" OnClick = "btnsave_Click" OnClientClick = "return AddCheck ();"/>View Code

 

 

  

Related Article

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.