我需要获取Master页面Label Control,但我只得到null。
母版页:
<div class="content">
<div class="container">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
<asp:TextBox ID="txtUName" runat="server" Text="Raji"></asp:TextBox>
<asp:Label runat="server" ID="Label1" Style="padding: 10px; font-size: medium; font-family: Calibri" align="left" Text="Save"/>
</asp:ContentPlaceHolder>
</div>
</div>
儿童页码背后:
public static void ClientMessage(Page p, string message)
{
Label _lblClientMessage_ = p.Master.FindControl("Label1") as Label;
}
请帮助我在子页面中获取此母版页标签控件。