'动态添加Web控件
Dim btnAdd As New Button
btnAdd.ID = "btnAdd"
btnAdd.Text = "New Button"
Me.Panel1.Controls.Add(btnAdd)
'动态添加用户控件
Dim uc As UC1
uc = CType(LoadControl("uc1.ascx"), UC1)
Me.Panel1.Controls.Add(uc)
Dim btnAdd As New Button
btnAdd.ID = "btnAdd"
btnAdd.Text = "New Button"
Me.Panel1.Controls.Add(btnAdd)
'动态添加用户控件
Dim uc As UC1
uc = CType(LoadControl("uc1.ascx"), UC1)
Me.Panel1.Controls.Add(uc)