根据国家/地区获取下拉列表中城市的值 [英] get the values of cities in dropdownlist according to the country
本文介绍了根据国家/地区获取下拉列表中城市的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我搜索.dll类或Web服务,也希望在.aspx页中查看其用途.
主要是我想用特定国家/地区的城市名称填充下拉列表.
i search a .dll class or web service and also want to see its use in .aspx page.
Mainly i want to fill the dropdownlist with the cities name of a particular country.
推荐答案
IIRC您的问题,没什么大不了的
IIRC your question, its not a big deal
解决方案链接 [
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
//Create object of WSGetCustomerCountryWise Object
localhost.WSGetCustomerCountryWise objGetCustomerCountryWise
= new localhost.WSGetCustomerCountryWise();
DataSet dsCustomer = new DataSet();
// Get the data from Webservice.
XmlElement elem = objGetCustomerCountryWise.GetCustomerCountryWise("USA");
// Load the XML to the Typed DataSet that you want.
XmlNodeReader nodeReader = new XmlNodeReader(elem);
dsCustomer.ReadXml(nodeReader, XmlReadMode.Auto);
GridView1.DataSource = dsCustomer;
GridView1.DataBind();
}
}
因此,此处将"美国"的值替换为国家/地区"下拉列表中选择的值.就这样. BTW单击解决方案链接 [
So here replace the value (USA) with Country dropdownlist selected value. That''s all. BTW Click the solution link[^] for more details
这篇关于根据国家/地区获取下拉列表中城市的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文