This is a migrated thread and some comments may be shown as answers.

Cancel Button and Undo All Changes

5 Answers 282 Views
Editor
This is a migrated thread and some comments may be shown as answers.
dgale
Top achievements
Rank 1
dgale asked on 14 Oct 2008, 05:10 PM
I'm trying to make a Cancel button for my RadEditor, but running into a problem.  On my site, I display the RadEditor as Enabled=false when the page loads.  The causes just the text to be seen, not all the editing controls and whatnot.

There is a "Add/Edit Text" button the user can click that will enable the RadEditor, and show my Submit and Cancel buttons.

When the user clicks my "Cancel" button, I'd like the RadEditor to once again be disabled AND discard any changes that were made.  I can disable it no problem, however the unsaved changes persist.

On the older RadEditor, when you clicked the native "Cancel" button, changes were discarded.  I'd like to replicate this using the new RadEditor.

Any suggestions?

5 Answers, 1 is accepted

Sort by
0
Accepted
Tervel
Telerik team
answered on 16 Oct 2008, 07:01 AM
Hello Dgale,

You should add a <asp:HiddenField> to your page with the editor and keep the "original content" there (or you can keep the content in the Session object)
When the user clicks Cancel - you should read the original content in the cancel button event handler and re-set it into the editor.



Best wishes,
Tervel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
dgale
Top achievements
Rank 1
answered on 16 Oct 2008, 04:38 PM
Thanks!  I'll give that a try.
0
d
Top achievements
Rank 1
answered on 17 Jun 2011, 04:06 AM
Is there any issue with saving html content with tags in the HiddenField control ? I am having a problem where after saving the html content in the HiddenField,  the save/cancel commands throw exceptions. If the content stored is plain text then everything works fine.
0
Rumen
Telerik team
answered on 20 Jun 2011, 02:07 PM
Hi,

Can you please set ValidateRequest="false" on the page with this issue? If the problem is other please send the error message and a screenshot of it?

Best regards,
Rumen
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
d
Top achievements
Rank 1
answered on 27 Jun 2011, 02:38 AM
Encoding the html content before assiging it to the hiddenfield control solved my problem. 
Tags
Editor
Asked by
dgale
Top achievements
Rank 1
Answers by
Tervel
Telerik team
dgale
Top achievements
Rank 1
d
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or