官方的方法:
编辑器调用方法
1.下载KindEditor最新版本。打开下载页面
2.解压zip文件,并把所有文件上传到您的网站程序目录下。例如:http://你的域名/editor/
3.要显示编辑器的位置添加TEXTAREA输入框。
注:id必须指定唯一值,还有有些浏览器上不设宽度和高度可能显示有问题,所以最好设一下宽度和高度。宽度和高度可用inline样式设置,也可用编辑器属性传进去。 
<textarea id="content_1" name="content" cols="100" rows="8" style="width:700px;height:300px;"></textarea>          4.该页面添加以下代码。 
<script type="text/javascript" charset="utf-8" src="/editor/kindeditor.js"></script><script type="text/javascript">    KE.show({        id : 'content_1' //TEXTAREA输入框的ID    });</script>问题:
我按照kindeditor官方的方法将相应代码加入到了MasterPage中的<head></head>标签,但是运行程序后提示“Microsoft JScript 运行时错误: 'KE' 未定义”,是何原因?母版部分代码:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title><%=Idcwest.Configuration.Config.AppSettings("ProductName")%> <%=Idcwest.Configuration.Config.AppSettings("Version")%></title> 
<script type="text/javascript" charset="utf-8" src="/editor/kindeditor.js"></script><script type="text/javascript">KE.show({ id: 'TextBox11' });</script>
<script src="js/AC_RunActiveContent.js" type="text/javascript"></script>
<script src="js/calendar_3.js" type="text/javascript"></script>                                                                                                                                                                                                                
<link href="img/style.css" type="text/css" rel="stylesheet"/>
</head>调用页面代码       <asp:TextBox ID="TextBox11" runat="server" 
                    Height="152px" TextMode="MultiLine" Width="554px"></asp:TextBox>
 
 

解决方案 »

  1.   

    使用了母板以后,服务器空间在HTML中的ID名字会改变,你看下HTML源码
      

  2.   

    同问,网上真不好查,不过我解决了,如二楼所言,ID问题:
        <script type="text/javascript">
            KE.show({
                id : document.getElementById('<%=content.ClientID %>').id ,
                imageUploadJson : '../../asp.net/upload_json.ashx',
                fileManagerJson : '../../asp.net/file_manager_json.ashx',
                allowFileManager : true,
        afterCreate : function(id) {
        KE.event.ctrl(document, 13, function() {
        KE.util.setData(id);
        document.forms['form1'].submit();
        });
        KE.event.ctrl(KE.g[id].iframeDoc, 13, function() {
        KE.util.setData(id);
        document.forms['form1'].submit();
        });
        }
            });
            
        </script>此段代码移动到textarea下面。