Hi and thanks in advance.
I am building drop downs dynamically then adding them to a panel, when postback occurs it does not hit my event handler. However I CAN get the event handler to be hit if I remove(comment out) the properties DataTextField and DataValueField while I am rebuilding the dropdownlist within OnInit on eachpostback. However when the dropdownlist is in this condition the sender to the eventhandler does not have it's properties like SelectedValue[Index] set.
Step 1: Build and load a drop down. The following is the event handler for selectedindexchanged on the lists. The drop down list is bound to a ListItemCollection that represent a few fields from a datatable. This dropdown is loaded into a panel and the panel in turn is loaded into a div. All of this functions as intended.protected void AnswerDDL_SelectedIndexChanged(object sender,EventArgs e)
DropDownList _ddlSender = new DropDownList();
_ddlSender = (DropDownList)sender;
_nextQuestionID = Convert.ToInt32(_ddlSender.SelectedValue);
DropDownList _newAnswerDDL = new DropDownList();
_newAnswerDDL = GetAnswerDropDown(_nextQuestionID);
View Complete Post