日期:2014-05-18 浏览次数:20951 次
foreach (string every_way in my_ways.Split(',')) { Button way_btn = new Button(); way_btn.ID = "way" + count_num.ToString(); way_btn.Style.Value = "width:120px"; way_btn.CssClass = "buttonone"; way_btn.Attributes.Add("onclick", "chooseme(" + count_num + ")"); way_btn.Text = every_way; show_my_way.Controls.Add(way_btn); count_num++; }
function chooseme(num) { document.getElementById("way_num").value = num; return false; } ...... <label runat="server" id="show_my_way"></label> <input runat="server" id="way_num" type="hidden"/>