我正在创建按钮,并将它们添加到要添加到页面上的表中:
void MyButtonTable()
{
TableRow myTableRow = new TableRow();
foreach (var item in buttons)
{
TableCell myTableCell = new TableCell();
myTableCell.Controls.Add(item);
myTableRow.Cells.Add(myTableCell);
}
HtmlForm html = new HtmlForm();
Table2.Rows.Add(myTableRow);
Table2.BorderWidth = 1;
Table2.BorderColor = System.Drawing.Color.Black;
html.Controls.Add(Table2);
Page.Controls.Add(html);
}我需要通过htmlForm添加它,并将它添加到将表直接添加到页面的page..instead中。(我获取类型为“Button”的控件“ctl02”必须放在具有runat=server的表单标记内。)但是当我添加html时,我想取消在attribute..to的运行,以防止这个异常的产生:
A page can have only one server-side Form tag发布于 2011-06-15 01:48:55
您需要在现有的<form runat="server">中添加表。
正如错误消息所述,您不能必须对服务器端执行<form>。
https://stackoverflow.com/questions/6347756
复制相似问题