如何识别下拉列表是否在asp.net中回发?

编程入门 行业动态 更新时间:2024-10-26 08:26:10
本文介绍了如何识别下拉列表是否在asp中回发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有三个下拉菜单国家/地区,州,城市有autopostback = true和一个显示按钮。 当我选择国家/地区下拉菜单时,页面也会每次加载 i想要选择下拉列表时要限制页面挂载。 如何在asp中实现 请给我你的宝贵建议

I have three dropdowns Country,state,city with autopostback=true and one show button . when I am selecting country dropdown, page is also loading everytime i want to ristrict pageloade while selecting the dropdownlilsts. How it is possible in asp Please give me Your valueble suggetions

推荐答案

嗨Srinivasa, 因为你使用的是autopostback,所以页面应该是加载。 我明白,您想要在国家/地区选择中加载州,然后在状态选择中加载您要列出的城市。 这样做。 保持autopost在国家和州的状态恢复正常,并在城市上关闭自动回复功能。 1)将所有三个控件放在一行中,所有三个控件都放在AJAX UpdatePanel中。您将需要scriptmanager来运行ajax。对于任意数量的AJAX,1个scriptmanager应该可以工作。 2)在国家选择上,在回发事件中,列出状态。跟踪国家/地区下拉列表是否已清除。 3)然后在州选择中,保留国家/地区价值,州值并填充城市。 现在,你还没有告诉我们应该做什么节目按钮,但我想在显示按钮点击,你想加载一些细节或其他页面或其他什么。 所以我猜你现在可以使用上面选择的下拉值了。 保持编码。 谢谢。 Hi Srinivasa, Since you are using autopostback, page is supposed to load. I understand, you want to load the state on country selection and then on state selection you want to list the cities. Do it like this. Keep autopost back true on country and state and turn auto postback off on city. 1) Put all three control in a single row and all three should be in an AJAX UpdatePanel. You will require scriptmanager to run ajax. For any number of AJAXs, 1 scriptmanager should work. 2) On country selection, on postback event, list the states. Keep track that country dropdown is not cleared. 3) Then on State selection, retain country value, state value and populate cities. Now, you have not told what show button is supposed to do, but i guess on show button click, you want to load some details or another page or whatever. So I guess you can use above selected dropdown values now. Keep coding. Thanks.

更多推荐

如何识别下拉列表是否在asp.net中回发?

本文发布于:2023-10-12 23:13:19,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1486154.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何识别   列表   asp   net   中回发

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!