views:

41

answers:

1

So I'm using the Ajax Control Toolkit and it's HTML Editor. I'm wondering what is the best approach to create a complete page preview? I have multiple HTML Editor's on the page so I need to get the content of each HTML Editor and save it to a cookie or something, then have a popup with the preview page, which loads the info from the cookies into respective labels. Is this possible or am I going in the wrong direction? Any and all advice is appreciated!

+1  A: 

Use JS to open a popup containing a template for the preview page, presumably with all the slots labeled with an appropriate id.

e.g.

<html><body><div id="main-content"></div></body></html>

Then, once the popup finishes loading, populate each slot with its corresponding content from the HTML editor on the main page.

e.g.

popup.document.getElementById('main-content').innerHTML = editors[0].getContent();
popup.document.getElementById('side-content').innerHTML = editors[1].getContent();

etc...

I'm not familiar with your specific toolkit or application, so you'll need to flesh it out to suite whatever API you're using.

Chris S