日期:2014-05-17 浏览次数:20425 次
Button[] Mybuttoe = new Button[dt.Rows.Count];
for (int i = 0; i < Mybuttoe.Length; i++)
{
Mybuttoe[i] = new Button();
buttoe.ID = "Mybuttoe" + i;
Mybuttoe[i].Text = dt.Rows[i][0].ToString().Trim();
if (Mybuttoe[i].Text != bcz.Value)
{
Mybuttoe[i].CssClass = "autobutton";
}
if (Mybuttoe[i].Text == bcz.Value)
{
Mybuttoe[i].CssClass = "autobuttonA";
}
Mybuttoe[i].Click += new System.EventHandler(buttoe_Click);
fi.Controls.Add(Mybuttoe[i]);
public Button buttoe = new Button();
protected void buttoe_Click(object sender, EventArgs e)
{
bcz.Value=((Button)sender).Text.Trim().ToString();
}