Assuming that you are using JQuery datepicker
http://jqueryui.com/demos/datepicker/[
^]
for your question:
.
.
examtime.Controls.Add(hr);
string script = string.Empty;
for (int b = 0; b < Convert.ToInt32(TextBox1.Text); b++)
{
TableRow tr = new TableRow();
for (int i = 0; i < 1; i++)
{
TableCell tc = new TableCell();
TextBox txtdate = new TextBox();
txtdate.ID = "dpicker" +b.ToString();
txtdate.Width = 75;
script += "$( '#" + txtdate.ID + "' ).datepicker();"
tc.Controls.Add(txtdate);
tr.Cells.Add(tc);
}
examtime.Controls.Add(tr);
}
if (script != string.Empty)
{
script = "<script>$(function(){" + script + "});</script>";
Page.ClientScript.RegisterStartupScript(this.GetType(), "registerDatePicker", script);
}