下拉列表中的国家明智城市 [英] country wise city in dropdown list

查看:90
本文介绍了下拉列表中的国家明智城市的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想按国家显示城市..
表示当我更改国家/地区时,然后在该城市的下拉列表中显示该国家/地区中的城市...
那我该怎么办??
请帮我..

i want to display city according to country..
means when i change country then in city dropdown display cities which is in that country...
so how can i do???
plz help me..
thanks in advance.

推荐答案

您可以使用AjaxControlToolkit的CascadingDropDown Extender来满足您的要求
请在波纹管链接上查看

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/CascadingDropDown/CascadingDropDown.aspx
You can use CascadingDropDown Extender of AjaxControlToolkit to achieve your requirement
Please view on the bellow link

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/CascadingDropDown/CascadingDropDown.aspx


下拉列表上有一个名为
There''s an event on the dropdownlist called SelectedIndexChanged[^] which fires up when a value has been selected on the control. That event for your Countries control should be existing on your code behind as that is where you will put the logic for retrieving the cities from your database. I assume you have a foreign key of the country on your Cities table so the retrieval is pretty straightforward. Also, you need to set Autopostback to true on the HTML/ASP.Net tag of your control so that the event will be fired.


这篇关于下拉列表中的国家明智城市的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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