Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do create an object of submenu items (not menu control) at various levels and disable a particular submenu from its content page?
Regards.
Posted
Updated 13-Feb-10 19:44pm
v2

You can access master page controls. You always have access to Master page from its content page through "this.Master"

You can expose various needs through properties of Master Page.
If you need to access the control then you can use:
this.Master.FindControl()

Once you get the control, cast it into valid type and have an access to all the valid properties of that control.

Google gave this as first link for more reference if needed:
Accessing Master Page Members from Content Pages in ASP.Net [^]
 
Share this answer
 
The other answer you got is correct, but I like to create a base class for my ASP.NET pages which encapsulates all the ugliness of getting ahold of a strongly typed instance of my master page class. Then I don't need Findcontrol, I can call public methods on the instance of my masterpage, instead of just the generic base methods.
 
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