Last post Oct 16, 2008 06:06 AM by naveen.gummudu
Oct 15, 2008 07:25 AM|dot dave|LINK
Hi Helpful people,
I am trying to do things I don't understand again.
I have nested master pages that work fine.
In one of the content pages I want to reference a button on the sub master.
The following code has been copied from the msdn site and modified to suite the datanames
in the content page -
in the code behind -
it does not work because mpContentPlaceHolder is nothing.
in the submaster -
The sub master provides a side menu tree defined above the NewSSO button. It is used by several pages
Would you help me get the reference to the button in the sub master please?
ddd dot Dave
nested master pages
Oct 15, 2008 09:56 AM|Dave Sussman|LINK
Content controls don't actually render anything into the control tree (you can see this if you turn tracing on), so there is no control called MainContent for it to find. You should just be able to get rid of the outer FindControl test and just find NewSSO.
Alternatively, if you do need some form of outer container, use a Panel control.
Oct 15, 2008 11:42 PM|dot dave|LINK
No, I don't need a container - I have nested master pages and "MainContent" is the id assigned to the contentPlaceHolder on the nested master.
I am trying to reference a contol on the nested master, and to achieve that it is necessary to reference the ContentPlaceHolder. I found the answer at -
My code now works -
Hopefully it will save someone a few hours research one day.
I appreciate your answer
Oct 16, 2008 06:06 AM|naveen.gummudu|LINK
check this link which i have already answered how to access the controls in nested masterpages