WYSIWIG 编辑器无法使用 .NET 中的更新面板 (AJAX)

发布于 2024-07-08 08:20:21 字数 750 浏览 5 评论 0原文

我们正在测试所见即所得编辑器,但我们无法让它们与异步回发一起工作。 我们将 TextBox(/textarea) 放入 UpdatePanel 中,并调用一个简单的保存到数据库的操作,所有所见即所得的工具栏都会消失,在文本框中留下一堆 HTML。

这是我们一直在努力实现的:nicedit.com/ 我们发现 CuteEditor 可以异步工作。 回发,但我们遇到了很多问题,所以我们完全废弃了它。

这些只是两个示例,但我们已经尝试了许多其他示例,包括 TinyMCE。 是什么导致 AJAX 调用出现混乱?

编辑 - 我同意 Thomas 的观点,即它与在“onLoad”事件期间运行 javascript 的所见即所得编辑器有关。 不幸的是,UpdatePanel 请求杀死了它并且不会重新呈现所见即所得编辑器。 所以其他人可以进行实验,这是另一个与 客户端 PageLoad 事件

编辑2 - 最终我最终将 WYSIWYG 加载/渲染事件绑定到 元素的使用 jQuery 的 onfocus 事件

We're testing WYSIWYG editors, and we cannot see to make them work with asynchronous postbacks. We put the TextBox(/textarea) in the UpdatePanel and call a simple save to the DB, and all of our WYSIWYG toolbars disappear, leaving us with a bunch of HTML in textboxes.

This is the one we've been working to implement: nicedit.com/
We have found that CuteEditor works with asynch. postbacks, but we've had so many problems with it, we're scrapping it entirely.

Those are just two examples, but we've tried a number of others, including TinyMCE. What is causing this to mess up on the AJAX call?

Edit -
I agree with Thomas that it has something to do with the WYSIWYG editor running javascript during the "onLoad" event. Unfortunately the UpdatePanel request kills that and doesn't re-render the WYSIWYG editors. So other people can experiment, here's another SO question that hooks into the client-side PageLoad event.

Edit 2 - Ultimately I ended up binding the WYSIWYG load/render event to the element's onfocus event using jQuery.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

长伴 2024-07-15 08:20:21

这主要是由于两个问题(独立于所见即所得的控制)。 WYSIWG 编辑器在“onLoad”事件上运行 JS(您无法轻松修复),或者您的 WYSIWYG 编辑器在变为可见时包含 JavaScript(如果不采取特殊操作,不会在 Ajax 请求中将其渲染回客户端)

This is mostly (independent upon your WYSIWYG control) due to two problems. Either the WYSIWG editor runs JS on the "onLoad" event (which you cannot fix easily) or your WYSIWYG editor includes JavaScript upon becoming Visible (which won't be rendered back to client in an Ajax Request without taking special actions)

萌化 2024-07-15 08:20:21

根据我对 TinyMCE 的记忆,您需要在 POST 之前关闭编辑器。

我还使用 InnovaStudio 取得了成功,但您必须为此付费(59.99 美元)。

我正在等待 WysiHat 我自己。

From what I remember from TinyMCE, you need to turn off the editor before your POST.

I've also had success with InnovaStudio, but you have to pay for it ($59.99).

I'm waiting for WysiHat myself.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文