demo.aspx 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <%@ Page Language="C#" AutoEventWireup="true" validateRequest="false" %>
  2. <script runat="server">
  3. protected void Page_Load(object sender, EventArgs e)
  4. {
  5. this.Label1.Text = Request.Form["content1"];
  6. }
  7. </script>
  8. <!doctype html>
  9. <html>
  10. <head runat="server">
  11. <meta charset="utf-8" />
  12. <title>KindEditor ASP.NET</title>
  13. <link rel="stylesheet" href="../themes/default/default.css" />
  14. <link rel="stylesheet" href="../plugins/code/prettify.css" />
  15. <script charset="utf-8" src="../kindeditor.js"></script>
  16. <script charset="utf-8" src="../lang/zh_CN.js"></script>
  17. <script charset="utf-8" src="../plugins/code/prettify.js"></script>
  18. <script>
  19. KindEditor.ready(function(K) {
  20. var editor1 = K.create('#content1', {
  21. cssPath : '../plugins/code/prettify.css',
  22. uploadJson : '../asp.net/upload_json.ashx',
  23. fileManagerJson : '../asp.net/file_manager_json.ashx',
  24. allowFileManager : true,
  25. afterCreate : function() {
  26. var self = this;
  27. K.ctrl(document, 13, function() {
  28. self.sync();
  29. K('form[name=example]')[0].submit();
  30. });
  31. K.ctrl(self.edit.doc, 13, function() {
  32. self.sync();
  33. K('form[name=example]')[0].submit();
  34. });
  35. }
  36. });
  37. prettyPrint();
  38. });
  39. </script>
  40. </head>
  41. <body>
  42. <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
  43. <form id="example" runat="server">
  44. <textarea id="content1" cols="100" rows="8" style="width:700px;height:200px;visibility:hidden;" runat="server"></textarea>
  45. <br />
  46. <asp:Button ID="Button1" runat="server" Text="提交内容" /> (提交快捷键: Ctrl + Enter)
  47. </form>
  48. </body>
  49. </html>