title: Not able to set label text in asp.net master page controls from content page
body: <p>I am trying to change the text of label in master page which is inside modal and from content page i am trying to set the text.
  This is my master page:</p>
  
  <pre><code>&lt;%@ Master Language="C#" AutoEventWireup="true" 
  CodeFile="MasterPage.master.cs" Inherits="MasterPage" %&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1 maximum-
      scale=1, user-scalable=no" /&gt;
      &lt;link href="../Content/bootstrap.min.css" rel="stylesheet" /&gt;
      &lt;link href="../Style/StyleSheet.css" rel="stylesheet" /&gt;
      &lt;link href="../Content/font-awesome.min.css" rel="stylesheet" /&gt;
      &lt;link href="http://fonts.googleapis.com/css?
      family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" 
      type="text/css" /&gt;
      &lt;link href="https://cdnjs.cloudflare.com/ajax/libs/jquery-footable/0.1.0/css/footable.min.css" rel="stylesheet" type="text/css" /&gt;
      &lt;script src="../Scripts/jquery-1.9.1.min.js"&gt;&lt;/script&gt;
      &lt;asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"&gt;
      &lt;/asp:ContentPlaceHolder&gt;
  &lt;/head&gt;
      &lt;body&gt;
      &lt;div id="header"&gt;
          &lt;form id="Form1" runat="server"&gt;
              &lt;header&gt;
              &lt;/header&gt;
              &lt;div class="container-fluid" id="body"&gt;
                  &lt;asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server"&gt;
                  &lt;/asp:ContentPlaceHolder&gt;
                  &lt;div class="modal fade" id="myModal"&gt;
                      &lt;div class="modal-dialog"&gt;
                          &lt;div class="modal-content" style="width: 400px;margin: 0 auto;"&gt;
                              &lt;div class="modal-header" runat="server"&gt;
                                  &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;
                                      &lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;
                                  &lt;h4 class="modal-title"&gt;&lt;asp:Label ID="lblMasterMessage" runat="server" Text="Label"&gt;&lt;/asp:Label&gt; &lt;/h4&gt;
                              &lt;/div&gt;
                              &lt;div class="modal-body"&gt;
                                  &lt;asp:Label ID="lblMasterbodyMessage" runat="server" Text="gh" /&gt;
                              &lt;/div&gt;
                              &lt;div class="modal-footer"&gt;
                                  &lt;button type="button" class="btn btn-primary" data-dismiss="modal"&gt;Close&lt;/button&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;footer class="panel-footer white"&gt;
                  &lt;div class="row"&gt;
                  &lt;/div&gt;
              &lt;/footer&gt;
          &lt;/form&gt;
      &lt;/div&gt;
      &lt;script src="../Scripts/bootstrap.min.js"&gt;&lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>script in child page which opens modal:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
       function openModal(message) {
            $('#myModal').modal('show');
        }
   &lt;/script&gt;
  </code></pre>
  
  <p>code behind child page calling the script and changing text of label in modalpopup</p>
  
  <pre><code>    ScriptManager.RegisterStartupScript(this, this.GetType(), "LaunchServerSide", "$(function() { openModal(); });", true);
      Label lblMaster = (Label)Master.FindControl("lblMasterbodyMessage");
      string message = "something";
      lblMaster.Text = message;
  </code></pre>
  
  <p>i also tried the second approach by setting properties in master page but text in the popup is not getting updated. any help will be appreciated</p>