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