首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

C#中動態增加htmlbutton,该如何解决

2012-01-29 
C#中動態增加htmlbutton我在C#中動態在Table中增加Htmlbutton控件,HtmlTableCell cnew HtmlTableCell()H

C#中動態增加htmlbutton
我在C#中動態在Table中增加Htmlbutton控件,
HtmlTableCell c=new HtmlTableCell();
HtmlButton lb=new HtmlButton();
lb.InnerText ="Edit";
//問題在這
lb.ServerClick +=new EventHandler(lb_Click);
我可不可在JS中定義觸發事件???
我該如何調用JS文件中的HtmlButton的觸發事件???

[解决办法]
HtmlTableCell c=new HtmlTableCell(); 
HtmlButton lb=new HtmlButton(); 
lb.InnerText ="Edit"; 
lb.Attributes.Add("onclick","you js code or function")
[解决办法]
http://www.weste.net/html/200404/20040429QBI094905.html
http://blog.csdn.net/liushengpiaoxu/archive/2007/09/05/1772695.aspx
http://www.cnblogs.com/oec2003/archive/2007/11/23/969638.html
http://dsdm.bokee.com/5330238.html
[解决办法]
HtmlTableCell c=new HtmlTableCell();
HtmlButton lb=new HtmlButton();
lb.InnerText ="Edit";
lb.Attributes.Add("onclick","所需调用JS中的代码")

热点排行