title: Button click doesn't stop triggering
body: <p>I have a button in an ASP page that I click to save some data to an SQL server. It works as intended, except that any time the page reloads (when doing other things) it triggers the submission again of that button. The result is duplicate records in the database. I realize I could probably validate for duplicates, but my concern is that if the button is still triggering a click on each refresh that it's consuming resources for no reason.</p>
  
  <p>On each refresh it says "To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier."</p>
  
  <p>I have searched the rest of the codebehind, HTML, and javascript file for any references to button11 and there are none. I'm stumped why it keeps triggering.</p>
  
  <p>The button's HTML:</p>
  
  <pre><code>&lt;asp:Button ID="button11" runat="server" OnClick="Button11_Click" /&gt;
  </code></pre>
  
  <p>Codebehind:</p>
  
  <pre><code>    protected void Button11_Click(object sender, EventArgs e)
  {
      var update = hfptstate.Value;
      string fname = fnamebox.Text;
      string lname = lnamebox.Text;
      string sex = sexbox.Text;
      string combname = fname + " " + lname;
      string init = null;
      string str = combname;
      str.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries).ToList().ForEach(i =&gt; init += i[0]);
      init += "_";
      Random rnd = new Random();
      int id = rnd.Next(1, 10000);
      string initid = init + id;
      string phone = phonebox.Text;
      string color = colorbox.Text;
      string age = agebox.Text;
      string datetime = DateTime.Now.ToString("MMM dd yyyy h:mmtt");
  
      SqlConnection con = new SqlConnection("Data Source=localhost\\SQLEXPRESS;AttachDbFilename=C:\\Users\\Public\\public website\\slDataBase.mdf;Integrated Security=True");
      SqlCommand cmd = new SqlCommand();
      if (statuslabel.InnerText == "Adding New Record")
      {
          cmd = new SqlCommand("INSERT into precordTable VALUES ('" + fname + "','" + lname + "','" + combname + "', '" + initid + "' , '' , '" + sex + "', '" + phone + "', '" + color + "', '" + age + "', '" + datetime + "', '','')", con);
      }
      else if (statuslabel.InnerText == "Editing Existing Record")
      {
          cmd = new SqlCommand("update precordTable set fname='" + fname + "', lname='" + lname + "', name='" + combname + "' , sex='" + sex + "', phone='" + phone + "', color='" + color + "', age='" + age + "' where initid='" + update + "';", con);
      }
      con.Open();
      cmd.ExecuteNonQuery();
      con.Close();
  
      statuslabel.InnerText = "Adding New Record";
      fnamebox.Text = "";
      lnamebox.Text = "";
      sexbox.Text = "";
      phonebox.Text = "";
      colorbox.Text = "";
      agebox.Text = "";
  
  }
  </code></pre>
  
  <p>Edit: I also know about bobby drop tables. It's not a concern for this specific implementation. </p>
  
  <p>Edit 2: I forgot to mention that just clicking the refresh button is enough to add duplicate records, and it doesn't even give the form submission warning ("To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier.")</p>