[CLOSED] confirm message problem

  1. #1

    [CLOSED] confirm message problem

    hi,

    i am using confirm box in my project. when i click the button, the confirm box open and ask yes,no. if i click yes ,then only call the ajaxevent.My problem is before i click yes in message box, ajax event fires.


    please see the code tell the solution.



    Thanks in advance.





    
    
    
    <%@ Page Language="C#" %>
    
    
    <%@ 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 Button1_Click(object sender, AjaxEventArgs e)
    
    
    {
    
    
    TextField1.Text = "success"; 
    
    
    
    
    
    }
    
    
    
    
    
    
    
    
    
    
    
    </script>
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    
    <head id="Head1" runat="server">
    
    
    <title>Untitled Page</title>
    
    
    
    
    
    
    
    
    <script>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    var confirmSend1 = function()
    
    
    {
    
    
    return Ext.MessageBox.confirm('CONFIRM', 'Confirm send?', function Test(Button1) { if(Button1 == 'yes') { return true } else {return false} } ); 
    
    
    
    
    
    
    
    
    }
    
    
    
    
    
    
    
    
    
    
    
    </script>
    
    
    </head>
    
    
    <body>
    
    
    <form id="form1" runat="server">
    
    
    <ext:ScriptManager ID="ScriptManager1" runat="server" Theme="Slate">
    
    
    </ext:ScriptManager>
    
    
    
    
    
    <ext:Button ID="Button1" runat="server" Text="success">
    
    
    <Listeners> 
    
    
    <Click Fn="confirmSend1" /> 
    
    
    </Listeners> 
    
    
    
    
    
    <AjaxEvents> 
    
    
    <Click OnEvent="Button1_Click"></Click> 
    
    
    </AjaxEvents>
    
    
    
    
    
    </ext:Button>
    
    
    
    
    
    
    
    
    
    
    
    <ext:TextField ID="TextField1" runat="server">
    
    
    </ext:TextField>
    
    
    
    
    
    
    </form>
    
    
    </body>
    
    
    </html>
  2. #2

    RE: [CLOSED] confirm message problem

    Hi,

    JavaScript doesn't support modal/block operations. Ext.Msg.confirm doesn't stop execution, it is async window.

    You should use confirm function in Before handler of AjaxEvent

    <AjaxEvents>
    ** * *<Click OnEvent="Button1_Click" Before="return confirm('Please Confirm!');" />
    </AjaxEvents>
    We added confirmation support to the AjaxEvent. Please see the following topic

    http://forums.ext.net/showthread.php?1613
    Last edited by geoffrey.mcgill; Feb 21, 2011 at 9:21 PM.

Similar Threads

  1. confirm message box problem
    By mehmood in forum 1.x Help
    Replies: 6
    Last Post: Jun 21, 2012, 1:47 PM
  2. Confirm message with wait not working
    By Mr.Techno in forum 1.x Help
    Replies: 1
    Last Post: Aug 08, 2011, 6:13 PM
  3. Confirm message handler
    By norphos in forum 1.x Help
    Replies: 1
    Last Post: May 18, 2011, 6:51 AM
  4. [CLOSED] Message box confirm dialogue handling
    By Etisbew in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Aug 07, 2009, 1:37 AM

Posting Permissions