Page 1 of 1

R11 HTMLEditor maintain viewstate in UpdatePanel

Posted: Sun Jan 31, 2016 4:29 am
by AbleMods
So I put a <cb:HTMLEditor> inside a modal popup, and the modal popup is inside an UpdatePanel.

Code: Select all

<cb:HtmlEditor runat="server" id="txt_Description" Width="450" Height="200px" ToolbarSet="Inline" MaxLength="1000" ViewStateMode="Enabled" EnableViewState="True"/>
But the HTMLEditor won't keep the .Text value on postback. So it never saves the changes to the content of the editor window.

If I remove the UpdatePanel, it's works flawlessly and the value is exactly what it should be on postback.

What am I missing?

The UI experience is so much better when it's inside an UpdatePanel and modal popup. I just hate to walk away from this and have to build a separate page just for adds and edits.

Re: R11 HTMLEditor maintain viewstate in UpdatePanel

Posted: Mon Feb 01, 2016 12:53 am
by mazhar
You can try a workaround where you can force a full post back when saving the HTML. In order to do this you need to add a trigger to update panel by doing something like this

Code: Select all

<asp:UpdatePanel ............ >
<Triggers>
        <asp:PostBackTrigger ControlID="SAVE_BUTTON_ID_HERE" />
    </Triggers>

Re: R11 HTMLEditor maintain viewstate in UpdatePanel

Posted: Mon Feb 01, 2016 2:38 am
by AbleMods
You. Are. A. GENIUS !!!

That worked perfectly, thanks :)

I've never fully understood how the whole <triggers> thing worked.