views:

960

answers:

4

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.

A: 

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.

Diodeus
+1  A: 

See if this helps http://nicedit.pbwiki.com/Saving+via+AJAX

loraderon
+1  A: 

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)

Thomas Hansen
This is basically what we're finding. If I'm in an UpdatePanel, only that UpdatePanel's editors disappear (/do not get re-rendered). Is there a hook somewhere that I can use to reload those editors after the ajax call?
Jon Smock
Well, I don't know too much about ASP.NET AJAX since I use another Ajax Library which solves this in a completely different way. But my guess is that ASP.NET AJAX have to have some sort of "Ajax Request Finished" callback which you could use. Though the correct thing to do would be to exclude updates to whatever panel the WYSIWYG editor resides within and do the JS parts of Ajax in that place. Though even better solution would be to ditch ASP.NET AJAX all together and get a real Ajax Framework which doesn't rely on Partial Rendering...
Thomas Hansen
A: 

Hi Diodeus, you mentioned that you did it successfully with InnovaStudio WYSIWYG control, could you please show us how you did that? We cannot get it work with updatepanel

Cassini