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

[Solved] How to display pop-up message with textbox?

1 Answer 448 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Chanh Vu
Top achievements
Rank 1
Chanh Vu asked on 01 Sep 2009, 03:17 PM
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:

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> 
 

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 04 Sep 2009, 07:47 AM
Hi Chanh,

You can attach to the OnClientSubmit event of RadEditor and using a javascript prompt function to fire a prompt dialog. You can submit the value of the reply variable to the server using a hidden field.

Sincerely,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Editor
Asked by
Chanh Vu
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or