Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have update panel in master page which contains two dropdown list states and city and i have update panel in content page which contains datalist control...how can i bind datalist according to selected value in dropdown lists
Posted

you can find dropdownlist value from master page by using this method.
C#
string StateValue;
DropDownList masterState = (DropDownList)Master.FindControl("ddlState");
DropDownList masterCity = (DropDownList)Master.FindControl("ddlCity");
StateValue = masterState.SelectedValue;
 
Share this answer
 
v2
Comments
Joezer BH 1-Sep-13 9:38am    
5ed!
It is pretty simple. From the content page, you can search for the controls in the master page and if the control is found, you can do something like this:
C#
DropDownList stateInMaster = null;
if(Master.FindControl("ddlState") != null)
 stateInMaster = (DropDownList)Master.FindControl("ddlState");
staring selectedStateValue = stateInMaster.SelectedValue;
 
Share this answer
 
v3
Comments
Joezer BH 1-Sep-13 9:38am    
5ed!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900