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

Preview Event For Editor

3 Answers 46 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Testing
Top achievements
Rank 1
Testing asked on 05 Feb 2014, 12:20 PM
Hi,
How to handle preview event of editor,
In that event I want to perform replace some text coming from db.

thank you

3 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 05 Feb 2014, 01:33 PM
Hello,

You can use the OnClientModeChange event to know when the user goes into preview mode: http://www.telerik.com/help/aspnet-ajax/editor-onclientmodechange2.html.


Regards,
Marin Bratanov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
0
Testing
Top achievements
Rank 1
answered on 06 Feb 2014, 05:27 AM
Hello,
It working perfectly, in that event I call server side button click event after executing server side the state of preview option is not maintain .. it again goes to design mode.
How can I maintain preview state after executing server side event?
0
Accepted
Shinu
Top achievements
Rank 2
answered on 06 Feb 2014, 06:51 AM
Hi,

Please try the following code snippet to achieve your scenario.

C#:
protected void RadButton1_Click(object sender, EventArgs e)
{
    //your code
    string script = "function f(){ChangeMode(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);
}

JavaScript:
<script type="text/javascript">
    function ChangeMode() {
        var editor = $find("<%=RadEditor1.ClientID %>");
        editor.set_mode(4);
    }
</script>

Hope this will helps you.
Thanks,
Shinu.
Tags
Editor
Asked by
Testing
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Testing
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or