大家看看我设置的table属性为什么不起作用
web窗体中添加了一个panel,panel中有一个table,前台代码如下:
<asp:panel>
<asp:Table ID = "Table1" GridLines ="Both"/>
</asp:panel
后台代码如下:
button1_click()
{ TableRow r = new TableRow();
TableCell c = new TableCell();
TableCell d = new TableCell();
c.Text = "项目名称";
TextBox tb = new TextBox();
tb.Text = ds.Tables["TelephoneNote"].Rows[0]["ItemName"].ToString().Trim();
d.Controls.Add(tb);
r.Cells.Add(c);
r.Cells.Add(d);
Table1.Rows.Add(r);
}
红色字体是我设置的Table1的属性,为什么执行后红色字体的属性不起作用呢???