title: JavaScript alert with yes no button
body: <p>I want to show alert with yes no button.</p>
  
  <p>here is my C# code :</p>
  
  <pre><code>using System;
  using System.Data;
  using System.Configuration;
  using System.Web;
  using System.Web.Security;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using System.Web.UI.WebControls.WebParts;
  using System.Web.UI.HtmlControls;
  using System.Data.OleDb;
  using System.Collections;
  using System.Windows.Forms;
  
  public partial class _Default : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
  
      }
      protected void Button1_Click(object sender, EventArgs e)
      {
          DialogResult dialogResult = MessageBox.Show("Sure", "Some Title", MessageBoxButtons.YesNo);
          if (dialogResult == DialogResult.Yes)
          {
              OleDbConnection con = new OleDbConnection("provider=Microsoft.ACE.OLEDB.12.0;data source= C:/Users/xyz/Documents/Visual Studio 2010/WebSites/accesspassword/stud.accdb;Jet OLEDB:Database Password=12345;");
              con.Open();
  
              OleDbCommand com = new OleDbCommand("insert into Table1 values(@Roll,@f_name)", con);
              OleDbParameter obj1 = new OleDbParameter("@Roll", DbType.StringFixedLength);
              obj1.Value = TextBox1.Text;
              com.Parameters.Add(obj1);
  
              OleDbParameter obj2 = new OleDbParameter("@f_name", DbType.StringFixedLength);
              obj2.Value = TextBox2.Text;
              com.Parameters.Add(obj2);
  
              com.ExecuteNonQuery();
              TextBox1.Text = "";
              TextBox2.Text = "";
              con.Close();
          }
          else if (dialogResult == DialogResult.No)
          {
              TextBox2.Text = "";
          }
      }
  }
  </code></pre>
  
  <p>This code is running fine but i want to do this using JavaScript alert with yes no button.
  I am using Visual Studio 2010 asp.net c#.</p>