title: Button Fires Twice - 2 records inserted in Database
body: <p>Running in MasterPage with AutoEventWireup = true.  I cannot change this. 
  Button inserts new record in database.<br>
  When button hits, two records insert. </p>
  
  <pre><code>  &lt;asp:Button ID="AddLab" Text="Add Lab" OnClick="AddLab_OnClick" CssClass="btn" runat="server" /&gt;
  </code></pre>
  
  <p>PageDirective: </p>
  
  <pre><code>    AutoEventWireup="true"  &lt;- I have tried removing this, setting to false.
  </code></pre>
  
  <p>PageLoad/PreRender show to show you nothing being done here with button: </p>
  
  <pre><code>    protected void Page_Load(object sender, EventArgs e)
      {
          if (!IsPostBack)
          {
              DbDataReader ddrGrp = rdoGroups();
              if (ddrGrp.HasRows)
              {
                  rdoGroup.DataSource = ddrGrp;
                  rdoGroup.DataBind();
              }
              ddrGrp.Close();
              // preset filter by lab to true
              CheckBox FiltLabs = (CheckBox)CommonUI.FindCtrlRecursive(this.Master, "FiltLabs");
              FiltLabs.Checked = true;
          }
  
      }
  
      protected override void OnPreRender(EventArgs e)
      {
          base.OnPreRender(e);
          // nothing yet
          rdoLabs.Items.Clear();
          DbDataReader ddrLab = rdoUserLabs();
          if (ddrLab.HasRows)
          {
  
              rdoLabs.DataSource = ddrLab;
              rdoLabs.DataBind();
              if (CommonUI.strTest((string)Session["rdoLabs"]))
              {
                  if (Convert.ToInt32(Session["rdoLabs"]) &gt; 0)
                  {
                      rdoLabs.SelectedValue = (string)Session["rdoLabs"];
                  }
              }
          }
          ddrLab.Close();
          // get group-lab mappings
          cboGroupLab.Items.Clear();
          DbDataReader ddrGroupLab = cboGroupLabsMap();
          if (ddrGroupLab != null)
          {
              if (ddrGroupLab.HasRows)
              {
  
                  cboGroupLab.DataSource = ddrGroupLab;
                  cboGroupLab.DataBind();
              }
          }
      }
  
      protected void AddLab_OnClick(object sender, EventArgs e)
      {
          LabAdmn labAdd = new LabAdmn();
          TextBox txtLab = (TextBox)CommonUI.FindCtrlRecursive(this.Master, "txtLab");
          CheckBox Active = (CheckBox)CommonUI.FindCtrlRecursive(this.Master, "cboLabActive");
          string[] strArr = new string[] { "lab_id" };
          labAdd.LabName = txtLab.Text;
          labAdd.Active = (bool)Active.Checked;
          // AddLab is where record is fired...see below...
          Hashtable ht = labAdd.AddLab(labAdd, strArr);
          ht = labAdd.AddLab(labAdd, strArr);
          if (ht != null)
          {
              HiddenField hLabId = (HiddenField)CommonUI.FindCtrlRecursive(this.Master, "hLabId");
              hLabId.Value = Convert.ToString(GetHTParm(ht, strArr[0]));
          }
  
  
      }
      #endregion AddLab_OnClick
  
      #region AddLab
      public Hashtable AddLab(LabAdmn labAdmn, string[] colOutputNames)
      {
          DAL myDal = new DAL(DBType, DB);
          Hashtable ht = new Hashtable();
          DAL.Parameters[] parms = new DAL.Parameters[]
          {
              new DAL.Parameters("driver_id","A",ParameterDirection.Input),
              new DAL.Parameters("lab_id",labAdmn.LabId,ParameterDirection.InputOutput),
              new DAL.Parameters("active",labAdmn.Active,ParameterDirection.Input),
              new DAL.Parameters("lab_name",labAdmn.LabName,ParameterDirection.Input)
          };
          CommandType cmdType = CommandType.StoredProcedure;
          string cmdText = "asp_Labs_Admin";
          ht = myDal.ExecuteQueryOutput(cmdType, cmdText, colOutputNames, parms, true);
          return ht;
  
      }
      #endregion AddLab
  </code></pre>
  
  <p>I've read that onclick and runat cause double processing.  If I remove runat, the button won't show since it is a server side button.   If remove the OnClick event, the event never fires regardless if AutoEventWireup is true, false, or removed. </p>