M
Matthew Workman
I have one aspx page where i am databinding two drop down lists based on a dataset (the data is being loaded from an XML Document). The fields get updated properly, no problem there. My question is: "How do you handle the events so that if the user chooses an option in the drop down, it poulates the cooresponding value in the second drop down?"
I have been splitting hairs on this, and I am at a point that I need some help from the community. Here is a look at the code I am using:
testpage.aspx:
<aspropDownList id="client" runat="server">
<aspropDownList id="wsname" runat="server">
testpage.aspx.cs
private void populate_fields()
{
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("params.xml"));
this.client.DataSource = ds.Tables[0];
this.client.DataTextField =ds.Tables[0].Columns[0].ToString();
this.client.DataBind();
this.wsname.DataSource = ds.Tables[0];
this.wsname.DataTextField =ds.Tables[0].Columns[1].ToString();
this.wsname.DataBind();
}
params.xml
<?xml version="1.0" encoding="UTF-8"?>
<clientList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<client>
<name>Client1</name>
<webservicename>WebServiceName1</webservicename>
</client>
<client>
<name>Client2</name>
<webservicename>WebServiceName2</webservicename>
</client>
</clientList>
Any help would be highly cherished.
Regards
Matthew Workman
I have been splitting hairs on this, and I am at a point that I need some help from the community. Here is a look at the code I am using:
testpage.aspx:
<aspropDownList id="client" runat="server">
<aspropDownList id="wsname" runat="server">
testpage.aspx.cs
private void populate_fields()
{
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("params.xml"));
this.client.DataSource = ds.Tables[0];
this.client.DataTextField =ds.Tables[0].Columns[0].ToString();
this.client.DataBind();
this.wsname.DataSource = ds.Tables[0];
this.wsname.DataTextField =ds.Tables[0].Columns[1].ToString();
this.wsname.DataBind();
}
params.xml
<?xml version="1.0" encoding="UTF-8"?>
<clientList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<client>
<name>Client1</name>
<webservicename>WebServiceName1</webservicename>
</client>
<client>
<name>Client2</name>
<webservicename>WebServiceName2</webservicename>
</client>
</clientList>
Any help would be highly cherished.
Regards
Matthew Workman