I have a WebHtmlEditor in a contentpage, when I 1st load the page this is the html for WebHtmlEditor:
<DIV style="WIDTH: 100%; FONT-FAMILY: sans-serif; HEIGHT: 100%; FONT-SIZE: 10pt; layout: layout-grid: both fixed 12px 12px" id=ctl00_ctl00_cphBody_cphBody_fvHardship_tabsItems_tabHardInfo_AdditionalInformationLabel_tw contentEditable=true align=left _oldE="true" content="false"><P>test add some more text and some more</P><P>and more</P></DIV>
After I do a postback the text is gone and the html changes to:
<DIV style="WIDTH: 100%; FONT-FAMILY: sans-serif; HEIGHT: 100%; FONT-SIZE: 10pt" id=ctl00_ctl00_cphBody_cphBody_fvHardship_tabsItems_tabHardInfo_AdditionalInformationLabel_tw align=left></DIV>
<input name="ctl00_ctl00_cphBody_cphBody_fvHardship_tabsItems_tabHardInfo_AdditionalInformationLabel_t_a" id="ctl00_ctl00_cphBody_cphBody_fvHardship_tabsItems_tabHardInfo_AdditionalInformationLabel_t_a" type="hidden" value="%3CP%3Etest add some more text and some more%3C/P%3E%3CP%3Eand more%3C/P%3E"/>
Notice the <p> are gone, now if I do a refresh the text is back.....Any help is appreciated.
I am still not able to get value after postback on Chrome (working on IE). I tried following steps:
I created keypress event using below code.
<ClientSideEvents KeyPress="Editor1_KeyPress"></ClientSideEvents>
Next created below function
function Editor1_KeyPress(oEditor, keyCode, oEvent) {
//Call update on each keypress to keep hidden field in sync with display.
oEditor._update();}
When I type something in editor my control successfully enter the method and executes "oEditor._update();" without any error.
Now, when I click on a button on page to make postback, I looses value of Editor
Thank you, Mackie.
I had the same issue and your suggestion helped me.
Add this as the KeyPress client side event handler:
function HtmlEditorKeyPress(oEditor, keyCode, oEvent) { //Call update on each keypress to keep hidden field in sync with display. oEditor._update();}
The problem is that in non-IE browsers the internal form variable is not updated as you type but only when focus is lost meaning that the old value can be set to the server if the blur event does not fire. The event handler above calls the internal function that does this syncing. Problem solved!
if you don't need spell checking straight off the ajaxtoolkit htmleditor works well!
PS. While debugging the project I can see that both the Text and the TextXHtml properties contains Markup language, even though the documentation specifies that only the later should. Could this somehow be related?