日期:2014-05-17  浏览次数:20489 次

KindEditor的问题,可以提取编辑器的内容保存到数据库,但是从数据库提出的数据如何在KindEditor显示呢?
用C#,VS2012开发工具的

1、代码如下

<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminSite.Master" AutoEventWireup="true" CodeBehind="AddNoticeList.aspx.cs" Inherits="User.Admin.AddNoticeList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script type="text/javascript" charset="utf-8" src="kindeditor/kindeditor.js"></script>

  <script type="text/javascript">

      KE.show({

          id: 'txtContent'

      });

      function Save()

      {

          var s = KE.util.getData("txtContent");

          s = KE.util.escape(s);

          //内容值

          document.getElementById("hdtxtContent").value = s;

          //标题值

          document.getElementById("<%=hdtxtTitle.ClientID%>").value = document.getElementById("txtTitle").value;

      }

  </script>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

     <table>

        <tr><td style="text-align:left">公告标题</td><td>

            <input id="txtTitle" type="text" />

            </td></tr>

     </table><br />

    <table>

        <tr>

            <td>公告内容</td>

            <td>  <textarea id="txtContent" name="nmtxtContent" style="width:700px;height:200px;visibility:hidden;"></textarea>

                <%--获取标题的隐藏域--%>

                <input id="hdtxtTitle" type="hidden" runat="server"/>

               <%-- 获取内容的隐藏域--%>

                <asp:HiddenField ID="hdtxtContent" runat="server" ClientIDMode="Static" />

            </td>

        </tr>

    </table>

    <div style="text-align:center">