title: Implementing javascript confirm box in code behind C#
body: <p>I want to implement javascript confirm box from code behind.</p>
  
  <p>My requirement is in a method I need to raise a confirm box ,based on the result I need to implement diff functionalites</p>
  
  <p>For Example;</p>
  
  <p>if OK of Confirm Box the add Tax</p>
  
  <p>if cancel Then do not add tax</p>
  
  <p>I am trying something like this but its not helping me</p>
  
  <pre><code>ScriptManager.RegisterStartupScript(Page, Page.GetType(), "confirm", "confirm('Add tax');", true);
  </code></pre>
  
  <p>Can anyone help.</p>
  
  <p>my sample Code is</p>
  
  <pre><code>protected void Button1_Click(object sender, EventArgs e)
  {
      Double mrp = 200.00;
  
      ScriptManager.RegisterStartupScript(Page, Page.GetType(), "confirm", "return confirm('Add Tax');", true);
      if (Confirm == "Ok")
      {
          //Add tax to mrp
      }
      else
      {
          //No tax for mrp
      }
  }
  </code></pre>
  
  <p>Thank You..</p>