首页 > Web开发 > 详细

.net 在ueditor修改编辑已有信息后提交 获取ueditor内容为null - 让人头疼的form 与 table

时间:2014-03-11 18:49:18      阅读:536      评论:0      收藏:0      [点我收藏+]
遇见问题过程:

在添加文章页面 引入Ueditor编辑器:

<script type="text/javascript" src="../../ueditor/ueditor.config.js"></script>
                                <script type="text/javascript" src="../../ueditor/ueditor.all.js"></script>
                                <link href="../../ueditor/themes/default/css/ueditor.css" rel="stylesheet" />
                                <script type="text/plain" id="cont" name="cont" style="width: 800px; height: 200px;"><%=cont %></script>
                                <script type="text/javascript">
                                    var editor = new baidu.editor.ui.Editor({
                                        textarea: ‘cont‘,
                                        autoHeightEnabled: true,
                                        elementPathEnabled: false,
                                        autoFloatEnabled: false
                                    });
                                    editor.render("cont");
                                </script>

在ueditor编辑器中输入内容 点击提交按钮 通过contex.request.form["cont"]成功获取到Ueditor编辑器中的内容。

但是 当我添加完成之后 ,再次点击文章列表进入编辑页后去修改文章内容  然后点击 提交按钮后 通过contex.request.form["cont"]获取到的内容竟然是null

百思不得其解,在无奈之际偶然发现 aspx 页面中 form标签 和table标签混插在了一起,看着TMD特别不爽,如下代码片段

 <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA">
            <form method="post" name="form1" id="form1" runat="server">
            <input type="hidden" name="dopost" value="save" />
            <tr>
                <td height="24" background="../img/tbg.gif">

于是乎我随手把form标签移出了table,放在了table标签之外。又非常手贱的点了一下提交按钮,我Kao,竟然获取到ueditor编辑器中的内容了... 一种惊喜一种无奈一种想骂人的冲动...


好吧,就这样一个问题解决了,分享给大家,希望对大家有用,记得把HTML标签写规范,就不会有这样恶心呕吐的事情发生了...

.net 在ueditor修改编辑已有信息后提交 获取ueditor内容为null - 让人头疼的form 与 table,布布扣,bubuko.com

.net 在ueditor修改编辑已有信息后提交 获取ueditor内容为null - 让人头疼的form 与 table

原文:http://blog.csdn.net/xiaoma0529/article/details/21001733

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!