我有一個下拉列表,用於填充計算中的一組數據。在我的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)任何建議?
你能提供更多關於你的問題的細節嗎?下拉式填充一些DataSet?或者你想在主頁上選擇一年下拉式選項,並在今年的所有其他頁面上查看? – Dima 2012-04-19 17:13:50
這兩個都有一點,裸露在我請你,我是這個網站的新手。從下拉菜單中選擇與當前會計年度相關的數據集,從1996年開始,我希望當用戶從主頁面選擇一年(即2007年)時,可以使用標籤來顯示其他每個當前選定值9頁。這有意義嗎? – developthestars 2012-04-19 17:17:26
@developthestars - 嗨,你有可能把標籤放在母版頁上嗎?我認爲它會起作用。訪問母版頁標籤來填充和顯示 – 2012-04-19 17:25:56