i 伙伴关系是新的。 NET,
i 正在形成国家,国家除名。
页: 1 具体国家,一将从XML档案中读到该国的国家。
<>->我无法在我的Droopdownlist......中找到必要的国家。
这里是我的密码,载于XMLFile.xml
。
<?xml version="1.0" encoding="utf-8" ?>
<countrys>
<country name="India">
<state value1="Maharashtra"></state>
<state value2="Kashmir"></state>
<state value3="Goa"></state>
</country>
<country name="Sri Lanka">
<state value1="Kanady"></state>
<state value2="Colombo"></state>
<state value3="Galle"></state>
</country>
<country name="Australia">
<state valu1e="Sydney"></state>
<state value2="Perth"></state>
<state value3="Melbourne"></state>
</country>
<country name="South Africa">
<state value1="Capetown"></state>
<state value2="Johanusburg"></state>
<state value3="Durban"></state>
</country>
</countrys>
缩略语
public partial class Country : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadDropdown();
}
}
protected void LoadDropdown()
{
DataSet ds = new DataSet();
ds.ReadXml (Server.MapPath("XMLFile.xml"));
DropDownListCountry.DataTextField = "country_text";
DropDownListCountry.DataSource = ds;
DropDownListCountry.DataBind();
DropDownListCountry.Items.Insert(0,new ListItem(" Select ","0"));
}
}
protected void DropDownListCountry_SelectedIndexChanged(object sender, EventArgs e)
{
string st = (DropDownListCountry.SelectedIndex).ToString();
XDocument main = XDocument.Load(@"XMLFile.xml");
var query = from state in doc.Descendants("countrys").Elements("country")
where st == state.Value
select state.NextNode;
DropDownListState.DataSource = query;
DropDownListState.DataBind();
}
}
http://www.ohchr.org。 反对不指标的。
<><>>> 感谢: