<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />

 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
 <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="Button1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadEditor1" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings> 
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel Skin="Web20" ID="RadAjaxLoadingPanel1" runat="server" ></telerik:RadAjaxLoadingPanel>
 
<telerik:RadEditor ID="RadEditor1" runat="server" Skin="Web20" ToolsFile="~/ToolsFile.xml"></telerik:RadEditor>
<asp:Button ID="Button1" style="display:none;" runat="server" Text="Button"  /> 

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
    RadEditorCommandList["Save"] = function(commandName, editor, oTool)
    {
        $get("Button1").click();
        setTimeout(function()
       {
            ajaxRequest("Save");
       },   1000);
    }
    RadEditorCommandList["Cancel"] = function(commandName, editor, oTool)
    {
        $get("Button1").click();
        setTimeout(function()
       {
            ajaxRequest("Cancel");
       },   1000);
    }
    function ajaxRequest(operation)
    {
      var ajaxManager = <%= RadAjaxManager1.ClientID %>;
      ajaxManager.ajaxRequest(operation);
    }
    </script>
</telerik:RadScriptBlock> 






        

    </form>
</body>
</html>
