kindeditor在asp.net中如何使用的總結

來源:互聯網
上載者:User

由於國外的伺服器好象對一些要引用dll編輯器由於安全問題,鎖定了web.config中的一些許可權,在先試了FreeTexbox不行,FCKEditor也不行,因為都是要引用dll檔案,最後同事介紹一款 純js的kindeditor編輯器,下載下來可是不會用啊,網上也找不到類似的方法,可能都沒遇到過這樣的問題,,經過一個晚上的研究demo及同事一起幫忙,終於研究出了如何使用,自己總結一下,也希望對以後需要的人有所協助.這裡以一個從資料庫讀取和儲存為例子,其它參數請參考kindeditor官方網站

1.首先把下面拷到要用編輯器的路徑
 <input  type="hidden" name="content1" id="content1"  value='<% = databind %>'/>
                                <input  type="hidden" name="content" runat="server" id="content"/>
                                <script type="text/javascript" src="KindEditor.js"></script>
                                <script type="text/javascript">
                                document.getElementById("content").value=document.getElementById("content1").value;
                          //這句是因為不能直接把content做為伺服器控制項才用的,那樣資料讀不出來,
                                var editor = new KindEditor("editor");     
                                editor.hiddenName = "content";
                                editor.editorWidth = "100%";
                                editor.editorHeight = "280px";
                                editor.show();
                                function KindSubmit() {
                                 editor.data();
                                }
                               
                                </script>

2.儲存按鈕

<asp:Button ID="CreateAdmine" runat="server" Height="22" Text="保 存" Width="42" OnClientClick="KindSubmit()" OnClick="CreateAdmine_Click" />//要用戶端提交才能儲存

3.後台讀取

先定義
 public string databind;

.....
if(dr.read())

{

databind=讀取的資料 ;

}

...

 4.儲存的值
  Name = content.Value;

 

本文來自CSDN部落格,轉載請標明出處:http://blog.csdn.net/sendling/archive/2007/07/08/1683094.aspx

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.