Refer the below sample code for your reference how to access the Label or span control to the child page.
Master page
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
Label Count Value : <asp:Label ID="lblCount" runat="server" Text=""></asp:Label><br />
<br />
Span Count Value : <span id="sCount" runat="server"></span>
<br />
<br />
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
Child Page
HTML
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<asp:Button Text="btnIncrement" runat="server" OnClick="InCrement" />
</asp:Content>
C#
public static int Count { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
Count++;
((Label)this.Master.FindControl("lblCount")).Text = Count.ToString();
((HtmlGenericControl)this.Master.FindControl("sCount")).InnerHtml = Count.ToString();
}
}
protected void InCrement(object sender, EventArgs e)
{
Count++;
((Label)this.Master.FindControl("lblCount")).Text = Count.ToString();
((HtmlGenericControl)this.Master.FindControl("sCount")).InnerHtml = Count.ToString();
}
VB.Net
Public Shared Property Count As Integer
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
If Not Me.IsPostBack Then
Count += 1
(CType(Me.Master.FindControl("lblCount"), Label)).Text = Count.ToString()
(CType(Me.Master.FindControl("sCount"), HtmlGenericControl)).InnerHtml = Count.ToString()
End If
End Sub
Protected Sub InCrement(ByVal sender As Object, ByVal e As EventArgs)
Count += 1
(CType(Me.Master.FindControl("lblCount"), Label)).Text = Count.ToString()
(CType(Me.Master.FindControl("sCount"), HtmlGenericControl)).InnerHtml = Count.ToString()
End Sub
Screenshot
