小弟刚学asp 求大神指教 关于后台添加html语句的问题
我想在后台放个按钮点击就添加一堆按钮要求是动态的,要求10个一换行,用后台语句来实现在.aspx页面添加html语句
这是我写的按钮点击事件
protected void btnAdd_Click(object sender, EventArgs e)
{
for (int i = 0; i < 10; i++)
{
Button btn = new Button();
btn.ID = "btn" + i;
PlaceHolder1.Controls.Add(btn);
Response.Write("<br>");
}
}
for (int i = 0; i < 10; i++)
{
Button btn = new Button();
btn.ID = "btn" + i;
PlaceHolder1.Controls.Add(btn);
}
Panel p = new Panel();
PlaceHolder1.Controls.Add(p);