日期:2014-05-17 浏览次数:20538 次
Button btn = new Button(); this.div2.Controls.Add(btn); btn.Text = ds.Tables[0].Rows[i][0].ToString(); btn.Style.Add("border", "white 2px solid"); btn.Attributes.Add("onclick", "<script>btn_onclick(this)</script>");
<form id="form1" runat="server"> <div id="divContainer" runat="server"> </div> <script type="text/javascript"> function test(id) { alert(id); } </script> </form>
------解决方案--------------------