用
protected void Page_Load(object sender, EventArgs e)
{
LinkButton LinkButton1 = new LinkButton();
LinkButton1.Text = "LinkButton1";
LinkButton1.Command += new CommandEventHandler(LinkButton1_Command);
PlaceHolder1.Controls.Add(LinkButton1);
}
protected void LinkButton1_Command(object sender, CommandEventArgs e)
{
Response.Write("");
}
((LinkButton)e.Row.Cells[8].Controls[0]).Attributes.Add("onclick", "")
我想说linkbutton本身就带有label的显示属性!为什么你就必须要在label的text中添加一个linkbutton控件?不是多此一举么?
直接拉一个linkbutton双击它进入点击事件编写