Ajax htmleditorextender粘贴的内容未更新到数据库 [英] Ajax htmleditorextender pasted content not updating to database

查看:74
本文介绍了Ajax htmleditorextender粘贴的内容未更新到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天,这让我非常疯狂地试图解决这个问题,所以经过七个令人沮丧的时间后,我会问这个问题。我在页面上有一个htmleditorextender。我可以在其中输入内容,并在提交时保存到数据库中 - 格式化和未格式化。但是,如果我从剪贴板(ctl v)将内容粘贴到其中,则不会将任何内容转移到数据库。我不能为我的生活看到我所缺少的...这里是代码的相关部分...非常感谢你看这个...



Good day, this is driving me absolutely crazy trying to solve this so after seven frustrating hours, I'll ask the question. I have an htmleditorextender on a page. I can type content into it and it saves to the database just fine on submit - formatted and unformatted. However, if I paste content into it from the clipboard (ctl v), nothing gets carried over to the database. I can't for the life of me see what I'm missing ... here is the relevant section of code... and many thanks for looking at this...

<asp:Label ID="Label2" runat="server" Text="Today's entry"></asp:Label><br />
    <ajaxToolkit:HtmlEditorExtender ID="HtmlEditorExtender1" 
        DisplaySourceTab="True"  runat="server" 
        TargetControlID="BContent">
         <Toolbar> 
                <ajaxToolkit:Cut />
                <ajaxToolkit:Copy />
                <ajaxToolkit:Paste />
                <ajaxToolkit:CreateLink />
                <ajaxToolkit:UnLink />
                <ajaxToolkit:RemoveFormat />
                <ajaxToolkit:SelectAll />
                <ajaxToolkit:UnSelect />
                <ajaxToolkit:Delete />
                </Toolbar>
    </ajaxToolkit:HtmlEditorExtender>

    <asp:TextBox ID="BContent" runat="server" Rows="16" TextMode="MultiLine" 
        Width="689px"></asp:TextBox>

推荐答案

好吧,好吧,我得到了部分工作。正如您在原始源代码中看到的那样,我只包含了一些按钮。一旦我开始在菜单中包含所有按钮,它就开始工作了。



这就是说,它运行不正常 - 没有正确翻译一些结束标签,剥离了一些段落和换行标签,它不允许我嵌入YouTube嵌入代码(我在santizer中假设)。所以基本上,除非我可以解决这些问题,否则这仍然是我项目中一个笨重但有问题的部分...我们非常感谢本段中有关这些问题的任何提示。或者,如果还有一种方法可以让它接受粘贴而无需在菜单中包含所有图标选项。我真的不希望人们在他们发布的内容中加粗和集中,并且做一些奇怪的事情。为你干杯。
Okay, well, I got it partly working. As you'll see in my original source code, I only have some of the buttons included. Once I started including all the buttons in the menu, it started working.

That said, it's not working well - not translating some closing tags correctly, stripping out some paragraph and line break tags, and it won't allow me to embed YouTube embed code (which I presume in the santizer). So basically, unless I can resolve those issues, this is still a clunky, problematic part of my project ... any tips on these issues in this paragraph are greatly appreciated. Or if there's a way to still have it accept a paste without having to have all the icon options in the menu. I really don't want people bolding and centering and doing weird stuff to the content they post. Cheers to you.


这篇关于Ajax htmleditorextender粘贴的内容未更新到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆