title: How to automatically Click button during runtime using C#
body: <p>I have created 100 buttons and want to first button clicked by default when page load first time(without clicking on button).</p>
  
  <pre><code>HtmlTable myTable = new HtmlTable();
  int n = 0;
  for (int i = 0; i &lt; 20; i++)
  {
      HtmlTableRow row = new HtmlTableRow();
      for (int c = 1; c &lt;= 5; c++)
      {
          n = (5 * i) + c;
          HtmlTableCell cell = new HtmlTableCell();
          Button btn = new Button();
          btn.Text = n.ToString();
          btn.ID = n.ToString();
          //btn.BackColor = Color.Transparent;
          btn.Width = 30;
          btn.Height = 25;
          btn.Click += new EventHandler(btn_Click);
          cell.Controls.Add(btn);
          row.Controls.Add(cell);
          myTable.Controls.Add(row);
          cell.Attributes.Add("Class", "htTableCellCss");
      }
      row.Attributes.Add("Class", "htTableRowCss");
  }
  myTable.Attributes.Add("Class", "htTableCss");
  btndiv.Controls.Add(myTable);
  </code></pre>