title: How can I access a Masterpage property from a base class or other functions file
body: <p>I'm accessing Masterpage properties from a regular ASP.NET C# page by doing the following:</p>
  
  <pre><code>((SecondMasterPage)(Page.Master)).speciallink = true;  
  ((SecondMasterPage)(Page.Master)).specialspan = false;
  </code></pre>
  
  <p>That works fine in a page's code-behind, but when I try to move it to a function in my base class file like this:</p>
  
  <pre><code>public class MyBaseClass : System.Web.UI.Page
  {
  public void portalFuncs()
  {
      ((SecondMasterPage)(Page.Master)).speciallink = true;  
      ((SecondMasterPage)(Page.Master)).specialspan = false;
  }
  }
  </code></pre>
  
  <p>... I get the following error message:</p>
  
  <p>Compiler Error Message: CS0246: The type or namespace name 'SecondMasterPage' could not be found (are you missing a using directive or an assembly reference?)</p>
  
  <p>My base class file is in my App_Code directory and other functions in there work without errors. Why won't this function work? Also if a function like this particular one won't work in my base class file, where could I put it so it would be available to be called from any page?</p>