Hi,
Add a panel to your aspx page and give this panel id as PopupControlID to ModalPopupExtender
Add controls dynamically to this panel in your code behind
TextBox txtTest = new TextBox();
txtTest.ID = "txtTest";
yourpanelid.Controls.Add(txtTest);
Hope this helps....