在ascx(control)下拉列表中未触发选定的索引事件 [英] In ascx(control) dropdownlist selected index event not fired

查看:66
本文介绍了在ascx(control)下拉列表中未触发选定的索引事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用控件("ascx"),并且已将其放入aspx页面中.
我的问题是

我有2个下拉列表,其中1个在页面加载事件中填充,而其他或第二个则根据第一个下拉列表的值进行填充

当我选择第一个下拉菜单时,selectedchange事件不会触发以填充另一个1.并且所有项都被删除
为什么会发生??

我已将auto postback属性设置为true,但对我来说没有任何帮助,当我在页面上复制所有代码时(不能放置控件ascx)

I am Using control ("ascx") and also i have placed it into aspx page
My Issue is

I have 2 dropdown 1 of them fill at page load event and other or second one fill according to value of first dropdown

When i select 1st Drop down It selectedchange event doesnot fired to fill the other 1 .And also its all item get removed
why its happening???

I have set auto postback property true but nothing its workin for me and when i copy all code on page its working(not to place control ascx)

推荐答案

绑定第一个下拉菜单之前是否处于以下条件?

Are you checking below condition before binding first dropdown?

if(!Page.IsPostBack())
{
DDl.datasource =ds;
DDl.DataBind();
}


这篇关于在ascx(control)下拉列表中未触发选定的索引事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆