将文本框动态插入用户控件

时间:2015-09-18 06:01:51

标签: c# asp.net

我想知道是否可以从主.aspx页面将文本框插入用户控件?如果是这样怎么办?我是asp.net的初学者,请帮助。

1 个答案:

答案 0 :(得分:0)

   TextBox tb1=new TextBox();
    tb1.ID="TbA";
    Uc1.Controls.Add(tb1);//here Uc1 is the Id of the userControl.Which is registered in .aspx file
相关问题