Click here to Skip to main content
16,020,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Sir

I have designed a WebUser Control in asp .Net.There is a DropDowList control called 'ddlCity' in the Usercontrol. I have used that user control in a content page. So how can i access the value of the DropDownList which is in Usercontrol from the Master page using Javascript. Plz help me Sir.


thank you
Best Regards
Sashi Meher
Posted

1 solution

value of the DropDownList which is in Usercontrol from the Master page using Javascript
Once the whole page is constructed, there is no master page-content page-user control in HTML format. All are clubbed together and a single page in HTML is formed. Thus, accessing a control of usercontrol from master page would be same as accessing a control on master page.

Try:
JavaScript
var dllcontrol = document.getElementById("<%=ddlCity.ClientID %>");
 
Share this answer
 
Comments
Espen Harlinn 21-Jul-12 7:53am    
5'ed!
Sandeep Mewara 21-Jul-12 12:22pm    
Thanks.

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