protected void Page_Load(object sender, EventArgs e)
{
ArrayList ArrMonth = new ArrayList();
for (int i = 1; i < 13; i++)
{
ArrMonth.Add(i);
}
rpt_month.DataSource = ArrMonth;
rpt_month.DataBind();
ArrayList ArrYear = new ArrayList();
for (int i = 1990; i < 2100; i++)
{
ArrYear.Add(i);
}
ddl_year.DataSource = ArrYear;
ddl_year.DataBind();
}
<asp:DropDownList ID="ddl_year" runat="server">
</asp:DropDownList>
<br />
<asp:Repeater ID="rpt_month" runat="server">
<ItemTemplate>
<ul>
<li><%# Container.DataItem %>月</li>
</ul>
</ItemTemplate>
</asp:Repeater>