我想使用for
循环在下拉列表中加载号码。
protected void DropDownList2_SelectedIndexChanged1(object sender, EventArgs e)
{
String Mon;
Mon = DropDownList3.SelectedItem.Text;
int noofday;
if (Mon == "Feb")
noofday = 28;
else
noofday = 31;
for (int j = 1; j <= noofday; j++)
{
DropDownList2.Items.Add(j.ToString());
}
}
但是下拉列表没有数字: