ASP.NET / C#: DropDownList SelectedIndexChanged in server control not firing

前端 未结 5 1515
我寻月下人不归
我寻月下人不归 2020-12-30 07:39

I\'m creating a server control that basically binds two dropdown lists, one for country and one for state, and updates the state dropdown on the country\'s selectedindexchan

5条回答
  •  醉酒成梦
    2020-12-30 08:13

    I can't see that you're adding these controls to the control hierarchy. Try:

    Controls.Add ( ddlCountries );
    Controls.Add ( ddlStates );
    

    Events won't be invoked unless the control is part of the control hierarchy.

提交回复
热议问题