0

I want to call a dialog which has yes & No options inside the button click event callback and, depending on the user answer (yes/No), I want to execute my next code.

protected void btn_Save_Click(object sender, EventArgs e)
{
    //some code here
    bool flag=false;
    if (HasLeave)
    {
        //Here I want to show alert with Yes-No
        If(Yes)
            flag=true;
        else
            flag=false;
    }
    if(flag)
    {}
    else
    {}
}
shridhar
  • 23
  • 7
  • 2
    Possible duplicate of [How to create a message box with "Yes", "No" choices and a DialogResult?](http://stackoverflow.com/questions/3036829/how-to-create-a-message-box-with-yes-no-choices-and-a-dialogresult) – Mihai Alexandru-Ionut Dec 10 '16 at 10:15
  • Possible duplicate of [How to create the confirm box in mvc controller?](http://stackoverflow.com/questions/15548073/how-to-create-the-confirm-box-in-mvc-controller) – IamK Dec 10 '16 at 10:19

0 Answers0