title: popup message in c# for single button with two operations
body: <p>I am working on asp.net using c#. For my project am using single button with two operations one for insertion and another one for deletion using "Selected Index". Two buttons are working for save data and to delete, but while written code to pop-up message for delete confirmation like alert(yes/no) its taking popup message for both insertion and deletion. Please suggest code to me either in c# or in java script. Help me.
     Thanks in advance</p>
  
  <p>This code am using,</p>
  
  <pre><code>        protected void SaveCountry_Click(object sender, EventArgs e) {
      if (Country.Text != "")       {
           if (SaveCountry.Text == "Save")       {
              bal_obj.CO_NAME = Country.Text;
              if (bal_obj.Add_country(bal_obj))  //This for Save                {
                  Country.Text = "";                }             }         }
  
                else            {                                                                  
  
              bal_obj.CO_ID = int.Parse(SelectCountryForUpdate.SelectedValue.ToString());
              bal_obj.CO_NAME = Country.Text;
              if (bal_obj.Dropcountry(bal_obj))    //This for Delete  {
                  SelectCountryForUpdate.SelectedIndex = 0;
                  Country.Text = "";    }   }  }
  </code></pre>
  
  <p>I need to show confirmation message for delete.</p>