0
我有一个Web应用程序,它将一段时间分配给一天中某种调度程序的学生。动态加载时调用用户控件按钮单击事件
因此,为此我有一个用户控件作为TimePeriod,并且此控件在网页上动态加载。
我的用户控件包含两个文本框和一个按钮控件,我需要找到该按钮的单击事件。在此按钮时,它应该检索两个相关文本框的值。但是我无法找到单击事件这个按钮。
此用户控件在该页面上的提交按钮事件的另一个页面上加载。 但是页面上该用户控件的数量各不相同,因此我有一个用户动态创建用户控件列表的代码。
例如目的,我已经设置j
值高达10,它实际上变化是这样的:
for (int j = 1; j < 10; j++)
{
TableRow row = new TableRow();
TableCell cell = new TableCell();
cell.Text = j.ToString();
cell.Height = 10;
cell.Width = 75;
row.Height = 10;
cell.BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.Gray);
//cell.BackColor = #FFFFFF;
row.Cells.Add(cell);
TimePeriod ib = (TimePeriod)LoadControl("TimePeriod.ascx");
TableCell cell1 = new TableCell();
cell1.BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.Gray);
cell1.Controls.Add(ib);
row.Cells.Add(cell1);
tbl1.Rows.Add(row);
cell = null; row = null;
}