I have a Repeater control which in some of its cells contains a UserControl which contains a DropDownList. On the ItemDataBound event of the Repeater control I'm assigning an event to the DropDownList like so:
protected void MyRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
...
MyControl myControl = (MyControl)e.Item.FindControl("MyControl01");
myControl.DataSource = myObject;
myControl.DataBind();
myControl.DropDownList.SelectedItemChange += MyMethod_SelectedIndexChanged;
myControl.DropDownList.AutoPostBack = true;
....
}
protected void MyMethod_SelectedIndexChanged(object sender, EventArgs e)
{
//Do something.
}
The event never fires. Please I need help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…