I have a formview with a dropdownlist created dynamically. i want to determine whether the dropdownlist was clicked. the code is written in the FormView1_DataBound method.
I get the following error in the line below that is in italics and underlined:
Unable to cast object of type 'System.Web.UI.WebControls.FormView' to type 'System.Web.UI.WebControls.DropDownList'.
Here is my code:
ddl_iFullname.DataSource = ObjectDataSource3
AddHandler ddl_iFullname.SelectedIndexChanged, AddressOf Me.Ddl_SelectedIndexChanged
Dim myddl As String = CType(sender, DropDownList).Text
myddl = myddl.ToUpper() '
Select Case myddl