I'm unable to find a Literal inside a Repeater that is in another UserControl.
I have the following UserControl:
<nav role="navigation">
<ul>
<li><a href="/"<asp:Literal id="litNavHomeActive" runat="server" />>Home</a></li>
<asp:Repeater id="rpt_NavItem" runat="server" OnItemDataBound="rpt_OnItemDataBound">
<ItemTemplate>
<li><a href="/<asp:Literal id="lit_Url" runat="server" />/"<asp:Literal id="lit_NavActive" runat="server" />><asp:Literal id="lit_Title" runat="server" /></a></li>
</ItemTemplate>
</asp:Repeater>
</ul>
<div class="cb"></div>
</nav>
This is placed inside a MasterPage and from another ContentPage, I'm trying to find "lit_NavActive" and hide it.
I am using this:
Repeater rpt = ((Theme)Page.Master).FindControl("Navigation").FindControl("rpt_NavItem") as Repeater;
Literal lit = rpt.FindControl("lit_NavActive");
if (lit != null) { lit.Visible = false; }
And its not working, if I do rpt.Visible = false; that works fine in hiding the whole repeater, so I'm close but fail to find the Literal (lit_NavActive) inside the Repeater. Any ideas?