I have a nested master page scenario where I have a menu both in main master and in the child master page. Now if I try to access either of the two… both are not accessible in the content page. I am using this code to access it. The variable n is getting null value.
Menu n = (Menu)this.Master.FindControl("Menu1");
Is your Menu control at the root level in this.Master? FindControl isn’t recursive, so if your Menu is nested inside of another control (a Panel, etc.) then FindControl will return null.
You can write your own recursive version of FindControl, which is what I did on a previous project. This is off the top of my head (I don’t have the code in front of me):
Call it this way: