title: call serverside method from html5 button onclick event
body: <p>I made a test application in which controls are html5 control.I have 2 textbox and a button of html5. I want to fire onclick event on html5 button and the method which is to be called through onclick event is on server side.</p>
  
  <p>I tried but it is not working.Can anyone help me to call the serverside method from a html5 button.I am posting my code.</p>
  
  <pre><code>//clientside code
  &lt;form id="form1" runat="server"&gt;
      &lt;div&gt;
          First name:&lt;input type="search" name="searchfield" placeholder="enter your name"
              autofocus="on" required="required" pattern="[A-z]" /&gt;
          E-mail:
          &lt;input type="email" name="emailfield" placeholder="enter emailid" /&gt;
  
          &lt;button onclick="btnSave_click" value="Click to Save" id="btnSave" runat="server" autofocus="autofocus" formtarget="_parent"&gt;
              Click to Save&lt;/button&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  
  // server side code
  protected void btnSave_Click(object sender, EventArgs e)
  {
      string name = Request.Form["searchfield"];
      string emailid = Request.Form["emailfield"];
      string dob = Request.Form["bday"];
  
      SqlConnection cn = new SqlConnection();
      cn.ConnectionString = "Data Source=CP1106\\SQLEXPRESS;Initial Catalog=Testdb;User ID=sa;Password=pwd";
  
      cn.Open();
  
      string query = "INSERT INTO TestTable(name, email) VALUES(@name, @email)";
  
      SqlCommand cmd = new SqlCommand(query,cn);
      cmd.Parameters.Add("@name", name);
      cmd.Parameters.Add("@email", emailid);
      // cmd.Parameters.Add("@bday", dob);
  
      cmd.ExecuteNonQuery();
  
      cn.Close();
      BindGrid();
  }
  </code></pre>