动态增加的用户控件,的属性问题!虽然分不多,但我很诚恳的请您帮我!在线等!!!
我在WebForm1.aspx.cs里用以下代码动态增加5个控件:
for(i=0;i<5;i++)
{
TableRow Row = new TableRow();
TableCell Cell = new TableCell();
//Create the userControl:StatList1
Control StatList1 = LoadControl("Module/StatList.ascx");
* Page.Controls.Add(StatList1);
Cell.Controls.Add(StatList1);
Row.Cells.Add(Cell);
Table.Rows.Add(Row);
}
在StatList.ascx文件里定义了属性:
public string UserID
{
get{ return lblinputuserid.Text;}
set{ lblinputuserid.Text = value;}
}
那为什么我在WebForm1.aspx.cs文件里,就是前面那段代码的标有星号的那个语句后用:StatList1.UserID 不能用?