Click here to Skip to main content
15,910,411 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
hi experts
I want a confirmation messagebox with Ext.Msg.Confirm:
if user clicks on No then stop running other code and if Yes then other code execute.

I did this:
C#
protected void SendSms_Click(object sender, AjaxEventArgs e)
{
    Ext.Msg.Confirm("Are you sure?", new Coolite.Ext.Web.MessageBox.ButtonsConfig
    {
        No = new Coolite.Ext.Web.MessageBox.ButtonConfig
        {
            Text = Resources.HASResource.Yes,
            // ???
        },
        Yes = new Coolite.Ext.Web.MessageBox.ButtonConfig
        {
            Text = Resources.HASResource.No
            //???
        }

    }).Show();
   
    // other code
}


but I don't know how to handle it. i tried Handler but it doesn't run
please help
thank you.
Posted
Updated 19-Jun-12 18:16pm
v3

1 solution

Hello

Add something like this, to Handler:
C#
Ext.Msg.Confirm("Are you sure?", new Coolite.Ext.Web.MessageBox.ButtonsConfig
   {
       No = new Coolite.Ext.Web.MessageBox.ButtonConfig
       {
           Text = Resources.HASResource.Yes,
          Handler = "Coolite.AjaxMethods.MyMethod(myParameter)"
       },
       Yes = new Coolite.Ext.Web.MessageBox.ButtonConfig
       {
           Text = Resources.HASResource.No
           //???
       }

   }).Show();

   // other code


Then add the method like this:
C#
[AjaxMethod]
public void MyMethod(string parameter)
{
   //...
}


I think it works.
 
Share this answer
 
Comments
Vartan Khachatourian 20-Jun-12 0:18am    
thank you shahin. I already found the answer but yours is correct and acceptable.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900