public void BindBatches()
{
DataTable dtgetbatches = new DataTable();
divBatches.Controls.Clear();
dtgetbatches = breederdailybal.GetBreederBatches();
if (dtgetbatches.Rows.Count > 0)
{
for (int i = 0; i < dtgetbatches.Rows.Count; i++)
{
Button btnbatch = new Button();
btnbatch.ID = dtgetbatches.Rows[i]["batch"].ToString();
btnbatch.Width = 90;
btnbatch.ForeColor = Color.White;
btnbatch.BackColor = Color.Green;
btnbatch.Click += new EventHandler(btnbatch_Click);
divBatches.Controls.Add(btnbatch);
LiteralControl @break1 = default(LiteralControl);
@break1 = new LiteralControl("        ");
divBatches.Controls.Add(@break1);
}
}
}
我想显示基于 dtgetbatches 对象的按钮。它不会生成正常的按钮是什么问题,请帮助我...