Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

How to get a master page control id in child page.



Thanks
Mohd. wasif
Posted
Comments
Mohd Wasif 29-Sep-11 8:08am    
This is solved.
Mohd Wasif 29-Sep-11 8:08am    
Label lblTime = (Label)Master.FindControl("lblTime");
is a solution

Example to access linkbutton of master page in Child page
((LinkButton)Master.FindControl("ContentPlaceHolder1").FindControl("lbtnSignUp")).Text = "Sign Up";


Like this you can access any control of maste page in child page
 
Share this answer
 
v2
Eg:


((Label)Master.FindControl("ContentPlaceHolder1").FindControl("lbl")).Text = "Your Text";
 
Share this answer
 
Hi,

Use my code for finding child control in master page
C#
((Image)Master.FindControl("imgid")).ImageUrl="~/images/asd.jpg";


All the Best
 
Share this answer
 

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