title: How to create a calendar dynamically?
body: <p>I am trying to create a calendar control dynamically and I would like to add the selected date that needs to be displayed in a text box.</p>
  
  <p>I need to do all this dynamically in code. I am trying it with this code here:</p>
  
  <pre><code>cell1.Controls.Add(new Label() {
                          ID = "Label" + childnodecount, 
                          Text = controllabel, 
                          ForeColor = System.Drawing.Color.Blue
                      });
  cell2.Controls.Add(new Calendar() { ID = "Calendar" + childnodecount });
  cell2.Controls.Add(new TextBox() { ID = "CalendarTextBox" + childnodecount });
  row.Cells.Add(cell1);
  row.Cells.Add(cell2);
  dynamictable.Rows.Add(row);
  SearchParameter = SearchParameter + controllabel + "=" 
                  + Request.Form["TextBox" + childnodecount] + "|";
  </code></pre>
  
  <p>The calendar is created, but when I select any date, all the created controls are gone from the page.</p>