L
Leon
Why this code is not working? I think the problem is in the business class
code.when I select a state from the dropdownlist, the school dropdownlist
suppose
to fill with school names, but somehow the state value is not getting back
to the business class. I think it's the way I'm using property get and set
accessor function.
****My Business Class------------
' Private variables
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
Private Shared myStateID As String
Public Shared Function GetSchoolByState(ByVal StateID As String) As DataSet
myStateID = StateID
Dim tool As New StuLotto.Accounts.Data.AccountsTool
Return tool.GetSchoolByStateList(myStateID)
End Function
' Properties
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
Public Property StateID() As String
Get
Return myStateID
End Get
Set(ByVal value As String)
myStateID = value
End Set
End Property
****My CodeBehind Class----------------
' Bind the school by selected state drop-down combobox
Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SStateDDL.SelectedIndexChanged
Dim Schools As New DataSet
Dim Value As String = SStateDDL.SelectedItem.Value
Schools = Accounts.Business.AccountsTool.GetSchoolByState(Value)
SNameDDL.DataSource = Schools
SNameDDL.DataTextField = "SchoolName"
SNameDDL.DataValueField = "SchoolID"
SNameDDL.DataBind()
End Sub
code.when I select a state from the dropdownlist, the school dropdownlist
suppose
to fill with school names, but somehow the state value is not getting back
to the business class. I think it's the way I'm using property get and set
accessor function.
****My Business Class------------
' Private variables
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
Private Shared myStateID As String
Public Shared Function GetSchoolByState(ByVal StateID As String) As DataSet
myStateID = StateID
Dim tool As New StuLotto.Accounts.Data.AccountsTool
Return tool.GetSchoolByStateList(myStateID)
End Function
' Properties
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
Public Property StateID() As String
Get
Return myStateID
End Get
Set(ByVal value As String)
myStateID = value
End Set
End Property
****My CodeBehind Class----------------
' Bind the school by selected state drop-down combobox
Private Sub SStateDDL_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SStateDDL.SelectedIndexChanged
Dim Schools As New DataSet
Dim Value As String = SStateDDL.SelectedItem.Value
Schools = Accounts.Business.AccountsTool.GetSchoolByState(Value)
SNameDDL.DataSource = Schools
SNameDDL.DataTextField = "SchoolName"
SNameDDL.DataValueField = "SchoolID"
SNameDDL.DataBind()
End Sub