Я пытаюсь передать некоторые значения на другую страницу, и у меня есть значения в List (Of String). Однако я получаю сообщение об ошибке ( во время разработки в среде IDE ), говорящее: в System.Web.UI.Page нет члена "X". Я смог получить собственность через Intellisense. Поэтому я не уверен, почему я получаю ошибку.
Вот код:
'Source Page (Default.aspx)-
Private locationDetails As List(Of String)
Public ReadOnly Property LocationsForDetail() As List(Of String)
Get
Return locationDetails
End Get
End Property
Private loadDetails As List(Of String)
Public ReadOnly Property LoadsForDetail() As List(Of String)
Get
Return loadDetails
End Get
End Property
Private optionDetails As List(Of String)
Public ReadOnly Property OptionsForDetail() As List(Of String)
Get
Return optionDetails
End Get
End Property
Protected Sub RadButton2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadButton2.Click
For Each facility As ListItem In CheckBoxList1.Items
If facility.Selected Then
locationDetails.Add(facility.Text)
End If
Next
For Each load As ListItem In CheckBoxList2.Items
If load.Selected Then
loadDetails.Add(load.Text)
End If
Next
optionDetails.Add(DropDownList2.SelectedValue)
optionDetails.Add(DropDownList3.SelectedValue)
optionDetails.Add(DropDownList4.SelectedValue)
optionDetails.Add(RadDatePicker1.SelectedDate.Value.ToShortDateString)
optionDetails.Add(RadDatePicker2.SelectedDate.Value.ToShortDateString)
Server.Transfer("Breakdown.aspx")
End Sub
'Target Page (Breakdown.aspx) -
Protected Sub populateChart()
Dim locations As List(Of String) = PreviousPage.LocationsForDetail 'get error here
Dim capacities As List(Of String) = PreviousPage.LoadsForDetail 'get error here
Dim rescOptions As List(Of String) = PreviousPage.OptionsForDetail 'get error here
bindData.populateChart(RadChart1, locations, capacities, rescOptions)
End Sub