title: UserControl, Child Master Page and Parent Master Page (How to call function form User Control)
body: <p>Basically I have a userControl.ascx with a lot of code... this user control is used in the Child.MasterPage and the Child.MasterPage inherits from a Parent.MasterPage.</p>
  
  <p>In the Parent.MasterPage I have a method in the .cs file, this method accepts a string and passes it to a literal.</p>
  
  <p>The problem:</p>
  
  <p>I have spent hours trying to pass a string from my UserControl directly to the Parent.MasterPage.cs method with no luck. The child.MasterPage does not have a c# file, it just inherits from the parent.master</p>
  
  <p>a line of code that I am using so that I can pass values to the patent.MasterPage reads like this.. but I am not able to pass to the method please help!</p>
  
  <pre><code>MasterPage myMasterPage = this.Parent.Parent.Page.Master.Master;.
  </code></pre>