I just have a problem that I can not workout a solution to.
I have a gridview which gets a bunch of controls created dynamically. What I want to be able to do is have one dropdownlist selection determine what is in the other dropdownlist control. I have the first one being populated fine but just have a problem getting the first selected index value to the second dropdownlist.
For the dropdownlist I have the following:
Expand|Select|Wrap|Line Numbers
- AddHandler field_ddl.SelectedIndexChanged, AddressOf OnSelectedIndexChanged
Expand|Select|Wrap|Line Numbers
- Private Sub OnSelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
- Dim myDropDownListName As String
- Dim myNewValue As String
- myNewValue = DirectCast(sender, DropDownList).SelectedValue
- myDropDownListName = DirectCast(sender, DropDownList).ID
- myDropDownListName = StringFunctions.JustColumnName(myDropDownListName)
- 'ParameterArray.Add(myDropDownListName)
- Dim myHTTP As String
- HttpContext.Current.Session(myDropDownListName) = myNewValue
- myHTTP = HttpContext.Current.Session(myDropDownListName)
- End Sub
Is there a way to make sure that the OnSelectedIndexChanged sub be called before the postback?
Thanks