避免在单击列表框时回发 [英] avoid postback on click of listbox

查看:78
本文介绍了避免在单击列表框时回发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我是ajax的新手.我正在开发asp.net应用程序,其中我有一个单选按钮列表和一个列表框.在检查单选按钮列表时,列表框每次都与新数据源绑定.

我已经使radioButtonList和ListBox的autoPostBack变为true.当我单击radioButton时,ListBox将填充不同的数据源.但是我想避免单击单选按钮列表以及列表框时的回发.

如何使用asp.net更新面板和触发器来实现.


请帮帮我.
在此先感谢.

Hello,

i m new in ajax .I am developing the asp.net applicaton in which i m having one radion button list and One list box. On checking of Radio button list the listbox bind every time with new datasource.

I have made autoPostBack true of both radioButtonList and ListBox.when i click on radioButton the ListBox Populate with Different Datasource. But I want to avoid the PostBack when I click on Radio Button List as well as ListBox.

How can I achive using asp.net Update Panel and Trigger.


Pls Help me.
Thanks in Advance.

推荐答案



您可以使用更新面板并将控件放置在更新面板中.这样可以避免重新加载整个页面,而可以进行部分渲染.

请参阅这些

http://www.asp.net/web-表格/教程/aspnet-ajax/understanding-asp-net-ajax-updatepanel-triggers [ http://msdn.microsoft.com/en-us/library/bb399001.aspx [ ^ ]
http://www.asp.net/ajax/documentation/live/overview/UpdatePanelOverview.aspx [^ ]
http://ajax.net-tutorials.com/controls/updatepanel-control/ [ ^ ]


一件事,我不建议您每次单选按钮选择更改时,都点击数据库并获取新的列表框项目,但是您可以筛选可用的数据源并将中间数据源绑定到列表框. >
希望对您有所帮助.
Hi,

you can use update panel and place your controls inside update panel. this will avoid the reloading of complete page, rather it will make partial rendering.

refer these

http://www.asp.net/web-forms/tutorials/aspnet-ajax/understanding-asp-net-ajax-updatepanel-triggers[^]
http://msdn.microsoft.com/en-us/library/bb399001.aspx[^]
http://www.asp.net/ajax/documentation/live/overview/UpdatePanelOverview.aspx[^]
http://ajax.net-tutorials.com/controls/updatepanel-control/[^]


one thing, i would not suggest you that every time when radio button selection changed,hit the database and get the new list box items, but instead you can filter on the available datasource and bind the intermediate datasource to the list box.

hope it helps.


在页面上将UpdatePanel与scriptmanager 一起使用.
Use UpdatePanel with a scriptmanager on your page.


这篇关于避免在单击列表框时回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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