title: Access Page variable from User Control
body: <p>I have a property on a page called </p>
  
  <pre><code>public string productName { get; set;  }
  </code></pre>
  
  <p>I want to access this in my usercontrol code behind. What's the right way to do it?</p>
  
  <p>Currently I am doing</p>
  
  <pre><code>((MyPage)Page).productName
  </code></pre>
  
  <p>But the user control is not compiling. My pagename is MyPage and I have also added a Reference</p>
  
  <pre><code>&lt;%@ Reference VirtualPath="~/MyPage.aspx" %&gt;
  </code></pre>