当前位置: 代码迷 >> ASP.NET >> 再度求指导
  详细解决方案

再度求指导

热度:5534   发布时间:2013-02-25 00:00:00.0
再次求指导
我在用户控件的Load事件里为用户控件中的div动态添加若干DropDownList,并且订阅了它的SelectedIndexChanged事件,
 ddls[j].SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);为什么我在页面操作DropDownList的时候改事件不触发?要用委托吗?谢谢大家啊。。

------解决方案--------------------------------------------------------
没有把ddls[j].SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);放到!ispostback里面吧?这种绑定不能放到!ispostback中

------解决方案--------------------------------------------------------
在 DropDownList 的 AutoPostBack="True" 设置为 True
------解决方案--------------------------------------------------------
用户控件有没有autopostback属性?
------解决方案--------------------------------------------------------
再试试Page_PreRender
------解决方案--------------------------------------------------------
多贴点代码看看
  相关解决方案