Get Text MessageBox

  1. #1

    Get Text MessageBox

    Hi,
    I have a MessageBox with multiline. I need, when User CLICK YES,
    get the text of the MessageBox in the Code-Behind?
    Is it possibile?
    <%@ Page Language="C#" %>
    <%@ Import Namespace="System.Threading"%>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        
    <script runat="server">
    
        protected void Button3_Click(object sender, AjaxEventArgs e)
        {
            Ext.Msg.Show(new MessageBox.Config
            {
                Title = "Address",
                Message = "Please enter your address:",
                Width = 300,
                Buttons = MessageBox.Button.OKCANCEL,
                Fn = new JFunction { Fn = "showResultText" },
                Multiline = true,
                AnimEl = this.Button3.ClientID,
                
            });
        }
        
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server">
        <title>MessageBox - Coolite Toolkit Examples</title>   
        
        <ext:ScriptContainer runat="server" /> 
       
       
        <script type="text/javascript">
    
            var showResultText = function(btn, text) {
                alert('Botão ' + btn + '  Texto ' + text);  
            };
        </script> 
        
        
    </head>
    <body>
        <ext:ScriptManager ID="ScriptManager1" runat="server"  />
        
        <h1>MessageBox Dialogs</h1>
        
        <h2>3. Multi-line Prompt</h2>
        
        A multi-line prompt dialog.
            <ext:Button ID="Button3" runat="server" Text="Show">
            <AjaxEvents>
                <Click OnEvent="Button3_Click" />
            </AjaxEvents>
        </ext:Button>
        
    </body>
    </html>
    Maia
    Coolite 0.8.2
  2. #2

    RE: Get Text MessageBox

    Any tip!
    Maia.
  3. #3

    RE: Get Text MessageBox

    It is possible with
    AjaxMethod. Below is the complete
    code.
    <%@ Page Language="C#" %>
    <%@ Import Namespace="System.Threading"%>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        
    <script runat="server">
    
        protected void Button3_Click(object sender, AjaxEventArgs e)
        {
            Ext.Msg.Show(new MessageBox.Config
            {
                Title = "Address",
                Message = "Please enter your address:",
                Width = 300,
                Buttons = MessageBox.Button.OKCANCEL,
                Fn = new JFunction { Fn = "showResultText" },
                Multiline = true,
                Closable = false,
                Icon = MessageBox.Icon.INFO,
                AnimEl = this.Button3.ClientID,
                
            });
        }
        [AjaxMethod]
        public void Texto(string txt)
        {
            string x = txt;        
                
        }
        
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server">
        <title>MessageBox - Coolite Toolkit Examples</title>   
        
        <ext:ScriptContainer runat="server" /> 
       
       
        <script type="text/javascript">
    
            var showResultText = function(btn, text) {
                alert('Botão ' + btn + '  Texto ' + text);
                if (btn == 'ok') { Coolite.AjaxMethods.Texto(text) };
            };
        </script> 
        
        
    </head>
    <body>
        <ext:ScriptManager ID="ScriptManager1" runat="server" />
        
        <h1>MessageBox Dialogs</h1>
        
        <h2>3. Multi-line Prompt</h2>
        
        A multi-line prompt dialog.
            <ext:Button ID="Button3" runat="server" Text="Show">
            <AjaxEvents>
                <Click OnEvent="Button3_Click" />
            </AjaxEvents>
        </ext:Button>
        
    </body>
    </html>
    Maia
    Coolite 0.8.2

Similar Threads

  1. [1.3] [2.0] No X.MessageBox from CodeBehind
    By ckarcz in forum 2.x Help
    Replies: 4
    Last Post: Mar 09, 2012, 4:59 PM
  2. [CLOSED] Text missing while dragging MessageBox
    By Etisbew in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 27, 2009, 11:44 AM
  3. MessageBox Example Not working
    By Tbaseflug in forum 1.x Help
    Replies: 5
    Last Post: Jun 18, 2009, 3:48 PM
  4. Ext.MessageBox
    By dbassett74 in forum 1.x Help
    Replies: 3
    Last Post: May 26, 2009, 6:13 PM
  5. ExtJS MessageBox
    By jchau in forum 1.x Help
    Replies: 0
    Last Post: Oct 09, 2008, 10:30 AM

Posting Permissions