无法从列表框中选择多个项目,因为自动回发是真的 [英] unable to select muliple item from listbox because auto postback is true

查看:77
本文介绍了无法从列表框中选择多个项目,因为自动回发是真的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!我有一个两个级联列表框,在asp.net c#中选择模式为multiple。第一个列表框包含公司名称,第二个列表框包含分支名称。当我从第一个列表框中选择公司名称时,相应的分支显示在第二个列表框中,但我想从第一个列表框中选择多个公司,并且相应的分支出现在第二个列表框中,我是无法选择多个选择,因为autopostback对于第一个列表框是真的,怎么做?帮助我

hello! i have a two cascading listbox with selection mode multiple in asp.net c#. first list box contain company name and second listbox contain branch name.when i select company name from first listbox,respective branch show in second listbox,but i want to select multiple company from first listbox and respective branch appear in second list box,i am unable to select multiple selection because autopostback is true of first listbox,how to do it?? help me

推荐答案

将列表框放在更新面板中。这样它只会执行部分回发。将更新面板设置为childrenastriggers false并将updatemode设置为conditional。现在在你的第二个列表框周围添加第二个更新面板(相同的参数)。



如果你从不调用updatepanel1.update()那么第一个列表框将不会重新加载,只会帖子。在您进行服务器端更改后调用updatepanel2.update()



这是实现ajax客户端帖子的廉价方式。还有其他方法可以做,但这是迄今为止最简单的
put the listbox in an updatepanel. That way it will only perform a partial postback. set the update panel to childrenastriggers false and updatemode conditional. Now add a second update panel around your second listbox (same params).

If you never call updatepanel1.update() then the first listbox will not reload and will only post. instead call updatepanel2.update() after you have made the serverside changes

This is a cheap way of implementing an ajax clientside post. There are other ways this can be done but this is by far the simplest


这篇关于无法从列表框中选择多个项目,因为自动回发是真的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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