带ddl的Asp.Net Usercontrol. [英] Asp.Net Usercontrol with ddl.

查看:73
本文介绍了带ddl的Asp.Net Usercontrol.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我在页面加载中添加了usercontrol.在此用户控件中,我有两个下拉列表.现在,当第一次加载它时,它在选定的索引更改上可以正常工作.但是当我通过单击添加按钮添加一个用户控件而不是下拉列表时不会填充.在用户控件的页面加载中,当它是Ispostback时,我已经填充了下拉列表.现在在这里,如果我删除了isposback而不是两个ddl都将显示所有数据.

In my project i have added usercontrol on page load . In this usercontrol i have two dropdown lists present in it. Now when it is first time loaded it works fine on selected index change. But when i add one more user control by clicking add button than the drop down does not populate.on the page load of user control i have populated dropdown list when it is Ispostback.now here if i remove the isposback than the both ddl will show all the data. which will not change on selected index change.

推荐答案


请设置条件是否不回传.
喜欢,
Hi,
Please set if condition to not postback.
like,
 if(!IsPostBack)
{
// code here
}


这篇关于带ddl的Asp.Net Usercontrol.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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