計算からのデータセットを入力するドロップダウンリストがあります。asp.netサイトには、メインページのドロップダウンリストからの現在のデータを含むラベルを表示したい複数のページがあります。これが私のコードです...
''' In the page load'''
Dim Val As Double
If Date.Now.Month = 10 OrElse Date.Now.Month = 11 OrElse Date.Now.Month = 12 Then
Val = Date.Now.Year
Else
Val = Date.Now.Year - 1
End If
For i = Val To 1996 Step -1
dropdownlist1.Items.Add(i)
Next
End Sub
'''function in a seperate class'''
Function GetDates(currentYear As Double) As String
Dim x As String
Return x
End Function
'''In the selected index event of the drop down (populates years ie. 2011, 2010, 2009)'''
Dim x As String = class1.GetDates(dropdownlist1.Text)
'''In the other pages load events'''
Dim x As String = class1.GetDates(label1.Text)
上記のコード行は、現在の年(つまり、2011、2010、2009)に入力したいものです。何か提案はありますか?