注册 登录
编程论坛 ASP.NET技术论坛

与“System.Web.UI.ControlCollection.Add(System.Web.UI.Control)”最匹配的重载方法具有一些无效参数

馨欣 发布于 2008-11-09 15:02, 2123 次点击
protected void Button1_Click(object sender, EventArgs e)
    {
        int newRows = Convert.ToInt32(TxtRows.Text);
        int newCols = Int32.Parse(TxtCols.Text);
        for (int i = 0; i < newRows; i++)
        {
            TableRow tb1Row = new TableRow();
            [un]tb1[/un].Controls.Add([un]tb1[/un].Rows);
            for (int j = 0; j < newCols; j++)
            {
                TableCell tb1Cell = new TableCell();
                tb1Cell.BorderStyle = BorderStyle.Dashed;
                tb1Cell.BorderWidth = Unit.Pixel(1);
                tb1Row.Controls.Add(tb1Cell);
            }
        }
    }

错误是在下划线 但不知道原因
1 回复
#2
shmilylee2008-11-10 10:40
tb1.Controls.Add(tb1Row);

[[it] 本帖最后由 shmilylee 于 2008-11-10 10:50 编辑 [/it]]
1