title: asp.net popup confirmation window
body: <p>I need to add an "are you sure" popup window to a delete button and I am not sure how to get whether the user clicked Ok or Cancel.</p>
  
  <p>Here is how I do it:</p>
  
  <pre><code>string message = "Are you sure you want to delete this user?";
              System.Text.StringBuilder sb = new System.Text.StringBuilder();
              sb.Append("return confirm('");
              sb.Append(message);
              sb.Append("');");
              Type type = this.GetType();
              ClientScript.RegisterOnSubmitStatement(type, "alert", sb.ToString());
  </code></pre>