关于字符的应用的?????好奇怪哦!!!!!
我在aspx.cs:
string test= " <asp:LinkButton ID=LBStr runat= 'server ' OnClick= 'LinkButton_Click ' ForeColor= '#8080FF ' Font-Underline= 'False '> 5 </asp:LinkButton> <td> ";
Label2.Text=test;
protected void LinkButton_Click(object sender, EventArgs e)
{
Response.Write( "电击到了 ");
}
结果没有执行??什么被我搞错了,请大家帮我看看!!!!!!
------解决方案--------------------给你一个建议你要实现的功能应该这样写:
1。将你要输出HyperLink 的 <td> 变为 <td id= "tdContainer " runat= "server ">
2.在aspx.cs中这样写
LinkButton lkb=new LinkButton();
lkb.Text= "test ";
this.tdContainer.Controls.Add(lkb);
lkb.Click += new EventHandler(LinkButton_Click);
...
protected void LinkButton_Click(object sender, EventArgs e)
{
Response.Write( "电击到了 ");
}
呵呵