Hi,
The master page is a naming container, if there is a textbox on the master page and its id is TextBox1 , but you will find its clientid is ctl00$TextBox1 at the render time, the "ctl00" is the master page's defautl id.
If the textbox1 is on the content page, you will find the textbox's clientid is ctl00$contentPlaceHolder$TextBox1, the "ctl00" is the master page's defautl id, the "contentPlaceHolder" is the contentplaceholder's id that is on the master page.
So if you want to use the findcontrol or the javascript's getElementById, you should be careful, you should use the control's clientID, you can get the control's clientid by view the page source at the render time.
A better approach is to establish a formal relationship between the master page and content page, and take advantage of strong typing. Instead of the content page poking around inside the master page, you can export the controls as the public properties in the master page codebehind,
You can try to add the following code to our master page.
Public Property FooterText() As String
Get
Return FooterLabel.Text
End Get
Set(ByVal value As String)
FooterLabel.Text = value
End Set
End Property
Then, try to use the property is to place a @ MasterType directive in our content page. When the ASP.NET compiler sees the @ MasterType directive, it creates a strongly typed Master property in our Page derived class.
<%@ Page Language="VB" MasterPageFile="~/Master1.master"
AutoEventWireup="true" %>
<%@ MasterType VirtualPath="~/Master1.master" %>
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Master.FooterText = "Custom footer text"
End Sub
</script>
Hope it helps.