title: add a button click event dynamically in asp.net 4.5 c#
body: <p>I have some questions to this post [1]: <a href="https://stackoverflow.com/questions/6187944/how-can-i-create-dynamic-button-click-event-on-dynamic-button">How can i create dynamic button click event on dynamic button?</a></p>
  
  <p>The solution is not working for me, I created dynamically an Button, which is inside in an asp:table controller.</p>
  
  <p>I have try to save my dynamic elements in an Session, and allocate the Session value to the object in the Page_Load, but this is not working.</p>
  
  <p>Some ideas</p>
  
  <h1>edit:</h1>
  
  <pre><code>        ...
          Button button = new Button();
          button.ID = "BtnTag";
          button.Text = "Tag generieren";
          button.Click += button_TagGenerieren;
  
          tabellenZelle.Controls.Add(button);
          Session["table"] = table;
      }
  
      public void button_TagGenerieren(object sender, EventArgs e)
      {
          TableRowCollection tabellenZeilen = qvTabelle.Rows;
          for (int i = 0; i &lt; tabellenZeilen.Count; i++)
          {
              ...
          }
      }
  
    protected void Page_Load(object sender, EventArgs e)
      {
          if (!Page.IsPostBack)
          {
  
              if (Session["table"] != null)
              {
                  table = (Table) Session["table"];
                  Session["table"] = null;
               }
          }
      }
  </code></pre>