I'd like to create a function to request user to enter a text message to describe the purpose of making change to the content in RadEditor. Could someone help me please? Here's the codes I've got so far:
And here is my codes in the client
| protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e) | |
| { | |
| if (e.Argument != "Save") | |
| { | |
| return; | |
| } | |
| //Some codes to save content comes here... | |
| //... | |
| } |
And here is my codes in the client
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Editor.aspx.cs" Inherits="ESS.Editor" %> | |
| <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head id="Head1" runat="server"> | |
| <title><%=GetTitle() %></title> | |
| <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> | |
| <script type="text/javascript"> | |
| function ajaxRequest(operation) | |
| { | |
| var ajaxManager = $find("<%=RadAjaxManager1.ClientID %>"); | |
| ajaxManager.ajaxRequest(operation); | |
| } | |
| </script> | |
| </telerik:RadScriptBlock> | |
| <script type="text/javascript"> | |
| function OnClientLoad(editor, args) | |
| { | |
| editor.fire("ToggleScreenMode"); | |
| } | |
| </script> | |
| </head> | |
| <body> | |
| <form id="form2" runat="server"> | |
| <telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableTheming="True"/> | |
| <div style="text-align: center"/> | |
| <telerik:RadAjaxManager ID="RadAjaxManager1" | |
| runat="server" | |
| OnAjaxRequest="RadAjaxManager1_AjaxRequest"> | |
| </telerik:RadAjaxManager> | |
| <telerik:RadEditor ID="RadEditor1" | |
| Runat="server" | |
| OnClientLoad="OnClientLoad" Height="500px" Width="100%"> | |
| <Content> | |
| </Content> | |
| <CssFiles> | |
| <telerik:EditorCssFile Value="ESS.css" /> | |
| </CssFiles> | |
| </telerik:RadEditor> | |
| <script type="text/javascript"> | |
| RadEditorCommandList["Save"] = function(commandName, editor, oTool) | |
| { | |
| ajaxRequest("Save"); | |
| } | |
| RadEditorCommandList["Cancel"] = function(commandName, editor, oTool) | |
| { | |
| ajaxRequest("Cancel"); | |
| } | |
| </script> | |
| </form> | |
| </body> | |
| </html> | |
