赞
踩
- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default2" %>
-
- <!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">
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title></title>
- <script type="text/javascript" src="ueditor/editor_config.js"></script>
- <script type="text/javascript" src="ueditor/editor_all.js"></script>
- <link rel="stylesheet" href="ueditor/themes/default/ueditor.css"/>
- <style type="text/css">
- #myEditor
- {
- width: 500px;
- }
- </style>
- </head>
- <body>
- <div>
- <form id="form1" runat="server" >
- <textarea id="myEditor" name="myEditor" runat="server" οnblur="setUeditor()">测试数据</textarea>
- <script type="text/javascript">
- var editor = new baidu.editor.ui.Editor();
- editor.render("myEditor");
-
- </script>
- <div id="myButton" runat="server">
- <asp:Button ID="Button3" runat="server" Text="获取数据" οnclick="btnTerst_Click" />
- </div>
- </form>
- </div>
- <script type="text/javascript">
- function setUeditor() {
- var myEditor = document.getElementById("myEditor");
- myEditor.value = editor.getContent();
- }
- </script>
- </body>
- </html>
- protected void btnTerst_Click(object sender, EventArgs e)
- {
-
- string editData = Server.HtmlDecode( myEditor.InnerHtml);
- this.ClientScript.RegisterStartupScript(this.GetType(),"","<script>alert('" + editData + "');</script>");
- //Session["editData"] = editData;
- //Response.Redirect("About.aspx");
-
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。