Click here to Skip to main content
15,896,727 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Web.Config, DLLs and NUnit Pin
Malcolm Smart9-Jul-07 3:43
Malcolm Smart9-Jul-07 3:43 
GeneralRe: Web.Config, DLLs and NUnit Pin
Kevin McFarlane9-Jul-07 11:51
Kevin McFarlane9-Jul-07 11:51 
QuestionFiltering files Pin
suparichit9-Jul-07 2:20
suparichit9-Jul-07 2:20 
AnswerRe: Filtering files Pin
Dave Sexton9-Jul-07 2:32
Dave Sexton9-Jul-07 2:32 
GeneralRe: Filtering files Pin
suparichit9-Jul-07 2:34
suparichit9-Jul-07 2:34 
QuestionControl Memory Footprint Pin
Dave Sexton9-Jul-07 1:54
Dave Sexton9-Jul-07 1:54 
QuestionPopulating DropDownList from XML? Pin
chand109-Jul-07 1:36
chand109-Jul-07 1:36 
AnswerRe: Populating DropDownList from XML? Pin
valerian.precop9-Jul-07 2:05
valerian.precop9-Jul-07 2:05 
Here is one method you could use:

1.
create a "ListItemCollection" (eg. lstAllNodes) object and populate it with all the pair values (StateCode,CountyName) from your XML (the text should be StateCode and the value should be CountyName).

2.
After that you should do something like this

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
string sText = DropDownList1.SelectedItem.Text;
ListItemCollection lstCountyName = new ListItemCollection();

foreach (ListItem lstTempItem in lstAllNodes)
{
if (lstTempItem.Text == sText)
{
lstCountyName.Add(lstTempItem);
}
}

DropDownList2.DataSource = lstCountyName;
DropDownList2.DataBind();
}

Where:
-lstAllNodes is the ListItemCollection object populated with all the nodes like I said at 1.

-DropDownList1 is your first drop down list with StateCodes (be carefull to have it runat server and set AutoPostBack="true" so that the SelectedIndexChanged event may trigger)

-lstCountyName is a second ListItemCollection (it is a temporary object and it's empty at first)
it's used to bind the second drop down list with the required values

-DropDownList2 your second drop down list with CountyNames


Just call me Valy... Smile | :)

AnswerRe: Populating DropDownList from XML? Pin
Imran Khan Pathan9-Jul-07 2:07
Imran Khan Pathan9-Jul-07 2:07 
QuestionSqlDataSource - use info in cs file?? Pin
munklefish9-Jul-07 1:30
munklefish9-Jul-07 1:30 
AnswerRe: SqlDataSource - use info in cs file?? Pin
Fred_Smith9-Jul-07 1:39
Fred_Smith9-Jul-07 1:39 
GeneralRe: SqlDataSource - use info in cs file?? Pin
munklefish9-Jul-07 2:37
munklefish9-Jul-07 2:37 
GeneralRe: SqlDataSource - use info in cs file?? Pin
Fred_Smith9-Jul-07 3:15
Fred_Smith9-Jul-07 3:15 
GeneralRe: SqlDataSource - use info in cs file?? Pin
munklefish9-Jul-07 3:28
munklefish9-Jul-07 3:28 
GeneralRe: SqlDataSource - use info in cs file?? Pin
Fred_Smith9-Jul-07 5:02
Fred_Smith9-Jul-07 5:02 
GeneralC# 2.0 Book Pin
Kuricheti9-Jul-07 1:18
Kuricheti9-Jul-07 1:18 
GeneralRe: C# 2.0 Book Pin
Parwej Ahamad9-Jul-07 1:32
professionalParwej Ahamad9-Jul-07 1:32 
GeneralRe: C# 2.0 Book Pin
Sathesh Sakthivel9-Jul-07 2:06
Sathesh Sakthivel9-Jul-07 2:06 
GeneralRe: C# 2.0 Book Pin
Dave Sexton9-Jul-07 2:35
Dave Sexton9-Jul-07 2:35 
GeneralRe: C# 2.0 Book Pin
Vasudevan Deepak Kumar9-Jul-07 2:54
Vasudevan Deepak Kumar9-Jul-07 2:54 
Questionpopup... Pin
pradeep kumarappagari9-Jul-07 1:15
pradeep kumarappagari9-Jul-07 1:15 
AnswerRe: popup... Pin
Parwej Ahamad9-Jul-07 1:28
professionalParwej Ahamad9-Jul-07 1:28 
GeneralRe: popup... Pin
pradeep kumarappagari9-Jul-07 1:31
pradeep kumarappagari9-Jul-07 1:31 
Questionhow to find lenth of div Pin
Piyush Vardhan Singh9-Jul-07 0:57
Piyush Vardhan Singh9-Jul-07 0:57 
AnswerRe: how to find lenth of div Pin
Christian Graus9-Jul-07 1:01
protectorChristian Graus9-Jul-07 1:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.