title: Display a "Yes / No" alert box in C# code behind
body: <p>I am trying to display a "Yes / No" messagebox from codebehind in C#. I want to call an "AddRecord" procedure if the user clicks "Yes", and do nothing if the user clicks "No".   </p>
  
  <p>Ideally, I want to use the code below, but from codebehind:</p>
  
  <pre><code>OnClientClick = "return confirm('Are you sure you want to delete?');"
  </code></pre>
  
  <p>I search on SO and google, but was not able to find anything helpful.</p>