当前位置:   article > 正文

asp.net集成百度ueditor富文本,在后台获取ueditor修改后的数据_ueditor aspx 后台获取代码

ueditor aspx 后台获取代码
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default2" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head runat="server">
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  6. <title></title>
  7. <script type="text/javascript" src="ueditor/editor_config.js"></script>
  8. <script type="text/javascript" src="ueditor/editor_all.js"></script>
  9. <link rel="stylesheet" href="ueditor/themes/default/ueditor.css"/>
  10. <style type="text/css">
  11. #myEditor
  12. {
  13. width: 500px;
  14. }
  15. </style>
  16. </head>
  17. <body>
  18. <div>
  19. <form id="form1" runat="server" >
  20. <textarea id="myEditor" name="myEditor" runat="server" οnblur="setUeditor()">测试数据</textarea>
  21. <script type="text/javascript">
  22. var editor = new baidu.editor.ui.Editor();
  23. editor.render("myEditor");
  24. </script>
  25. <div id="myButton" runat="server">
  26. <asp:Button ID="Button3" runat="server" Text="获取数据" οnclick="btnTerst_Click" />
  27. </div>
  28. </form>
  29. </div>
  30. <script type="text/javascript">
  31. function setUeditor() {
  32. var myEditor = document.getElementById("myEditor");
  33. myEditor.value = editor.getContent();
  34. }
  35. </script>
  36. </body>
  37. </html>

青岛西海岸就业网

  1. protected void btnTerst_Click(object sender, EventArgs e)
  2. {
  3. string editData = Server.HtmlDecode( myEditor.InnerHtml);
  4. this.ClientScript.RegisterStartupScript(this.GetType(),"","<script>alert('" + editData + "');</script>");
  5. //Session["editData"] = editData;
  6. //Response.Redirect("About.aspx");
  7. }


声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/230340
推荐阅读
相关标签
  

闽ICP备14008679号