Hi everyone, I've a very strange problem!
There are 2 master page in my web project:
the first one is MasterPageA.Master which has some controls; the second one is MasterPageB.Master which is son of MasterPageA and it has some other controls.
There is also another page, named Default1.aspx, which is son of MasterPageB.Master.
I need to access to a label control put in the Content part of MasterPageB.Master.
I tried to fit the code that I usually use for one level (Master-Son) found at this page and I've write in Default.aspx.vb this code:
These are the definitions (just the relevant code) of MasterPageA.Master and MasterPageB.Master:Code:Dim oContent As Content, oLabel as Label oContent = CType(Master.FindControl("Content1"), Content) If Not oContent Is Nothing Then oLabel = CType(oContent.FindControl("lblContatti"), Label) Endif
MasterPageA.Master
MasterPageB.MasterCode:...cut... <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> ...cut....
Any help is appreciated.Code:<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:Label ID="lblContatti" runat="server" Text="E-Mail" CssClass="lblSchedaArticolo"></asp:Label> </asp:Content> .... ....
Best regards
Maurice




Reply With Quote