<%@ Page Language="VB" debug="true"%>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
If Not Page.IsPostBack Then
Call Populate_MonthList()
Call Populate_YearList()
End If
End Sub
Sub Populate_MonthList()
drpCalMonth.Items.Add("一月")
drpCalMonth.Items.Add("二月")
drpCalMonth.Items.Add("三月")
drpCalMonth.Items.Add("四月")
drpCalMonth.Items.Add("五月")
drpCalMonth.Items.Add("六月")
drpCalMonth.Items.Add("七月")
drpCalMonth.Items.Add("八月")
drpCalMonth.Items.Add("九月")
drpCalMonth.Items.Add("十月")
drpCalMonth.Items.Add("十一月")
drpCalMonth.Items.Add("十二月")
drpCalMonth.Items.FindByValue(MonthName(DateTime.Now.Month)).Selected = True
End Sub
Sub Populate_YearList()
'Year list can be extended
Dim intYear As Integer
For intYear = DateTime.Now.Year - 20 To DateTime.Now.Year + 20
drpCalYear.Items.Add(intYear)
Next
drpCalYear.Items.FindByValue(DateTime.Now.Year).Selected = True
End Sub
</script>
<form id="frmCalendar" runat="server">
<table>
<tbody>
<tr>
<td>
<asp:DropDownList id="drpCalMonth" Runat="Server"></asp:DropDownList>
<asp:DropDownList id="drpCalYear" Runat="Server"></asp:DropDownList>
</td>
</tr>
</tbody>
</table>
</form>
浙公网安备 33010602011771号