开发者

CKEditor and asp.net

开发者 https://www.devze.com 2023-02-01 07:17 出处:网络
I am using CKEditor on my page. It is working fine except when I post back. I am getting this error: A potentially dangerous Request.Form value was detected from the client (ctl00$MainContent$txtDesc

I am using CKEditor on my page. It is working fine except when I post back. I am getting this error:

A potentially dangerous Request.Form value was detected from the client (ctl00$MainContent$txtDesc="<p> &nbsp;</p&g开发者_Go百科t;

I am using this code to put CKEditor value into textbox on OnClientClick event of submit button:

function getEditorValue(){
    var editor=$("#<%= txtDesc.ClientID%>").ckeditorGet();
    editor.updateElement();
    return true;
}


Have you tried setting the htmlEncodeOutput property?

> CKEDITOR.replace('#<%= txtDesc.ClientID%>', {
>  htmlEncodeOutput: true });

This should encode the output and you should be able to avoid setting the requestValidationMode.

Documentation for it is here: ckEditor documentation


Set ValidateRequest="False" in your <% @Page declaration.

0

精彩评论

暂无评论...
验证码 换一张
取 消