Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I have top level master page (Master.master) in my umbraco website and then another master page (Home.master) which inherits the top-level one. Eg.
In the Home.master I have a control:
<asp:Content ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
<umbraco:Item field="box1Title" runat="server" />
</asp:Content>
and a reference to the Master.master of course:
<%@ Master Language="C#" MasterPageFile="~/masterpages/Master.master" AutoEventWireup="true" %>
I need to access controls of Home.master from Master.master.
I'm trying:
umbraco.presentation.templateControls.Item box1Title = (umbraco.presentation.templateControls.Item)MainContentPlaceHolder.FindControl("box1Title");
but it returns null object
Can anybody spot what I'm doing wrong?
Thank you for help
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Code Behind access to lower level master controls
Hi,
I have top level master page (Master.master) in my umbraco website and then another master page (Home.master) which inherits the top-level one. Eg.
In the Home.master I have a control:
<asp:Content ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
<umbraco:Item field="box1Title" runat="server" />
</asp:Content>
and a reference to the Master.master of course:
<%@ Master Language="C#" MasterPageFile="~/masterpages/Master.master" AutoEventWireup="true" %>
I need to access controls of Home.master from Master.master.
I'm trying:
umbraco.presentation.templateControls.Item box1Title = (umbraco.presentation.templateControls.Item)MainContentPlaceHolder.FindControl("box1Title");
but it returns null object
Can anybody spot what I'm doing wrong?
Thank you for help
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.