Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Getting the Values of Controls on the Master Page At run time, the master page is merged with the content page, so the controls on the master page are accessible to content page code. (If the master page contains controls in a ContentPlaceHolder control, those controls are not accessible if overridden by a Content control from the content page.) The controls are not directly accessible as master-page members because they are protected. However, you can use the FindControl method to locate specific controls on the master page. If the control that you want to access is inside a ContentPlaceHolder control on the master page, you must first get a reference to the ContentPlaceHolder control, and then call its FindControl method to get a reference to the control.</p> <p>The following example shows how you can get a reference to controls on the master page. One of the controls being referenced is in a ContentPlaceHolder control and the other is not.</p> <p>Visual Basic Copy Code ' Gets a reference to a TextBox control inside a ContentPlaceHolder</p> <pre><code>Dim mpContentPlaceHolder As ContentPlaceHolder Dim mpTextBox As TextBox mpContentPlaceHolder = _ CType(Master.FindControl("ContentPlaceHolder1"), _ ContentPlaceHolder) If Not mpContentPlaceHolder Is Nothing Then mpTextBox = CType(mpContentPlaceHolder.FindControl("TextBox1"), _ TextBox) If Not mpTextBox Is Nothing Then mpTextBox.Text = "TextBox found!" End If </code></pre> <p>Since you want to Find a nested Content place holder you may have to find the parent then use that instance to find the child</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload