title: how to access ascx custom control property from masterpage.master.cs
body: <p>I have this following property in my custom user control:</p>
  
  <pre><code>public string selectedtab 
          {
              get
              {
                  if (ViewState["AdminCurrentNavID"] != null)
                  {
                      return ViewState["AdminCurrentNavID"].ToString();
                  }
                  else {
                      isfirstload = true;
                      return null;                
                  }
              }
  
              set { ViewState["AdminCurrentNavID"] = value; }
          }
  </code></pre>
  
  <p>I am setting the value of it on my Page_Load() in ascx control. What i need to do is that after setting the value of this property I need to access it from masterpage.cs in code behind. you can see how currently I am trying to do in below code, but the issue is that I am not able to get the value i thing it is because the masterpage's Page_Load() rendering before the ascx control so I thats why I am getting null value, please help, thanks.</p>
  
  <p><strong>masterpage.cs:</strong></p>
  
  <pre><code>usercontrols.mainmenu adminmenu = (usercontrols.mainmenu)LoadControl("~/mymenupath.ascx");
  lbmsg.Text = adminmenu.selectedtab;
  </code></pre>