日期:2014-05-18  浏览次数:20816 次

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中的代码")