R11 HTMLEditor maintain viewstate in UpdatePanel

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

R11 HTMLEditor maintain viewstate in UpdatePanel

Post by AbleMods » Sun Jan 31, 2016 4:29 am

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.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: R11 HTMLEditor maintain viewstate in UpdatePanel

Post by mazhar » Mon Feb 01, 2016 12:53 am

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>

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: R11 HTMLEditor maintain viewstate in UpdatePanel

Post by AbleMods » Mon Feb 01, 2016 2:38 am

You. Are. A. GENIUS !!!

That worked perfectly, thanks :)

I've never fully understood how the whole <triggers> thing worked.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

Post Reply