title: Can't find ASP.NET master page
body: <p>I'm trying to get my content page to be able to access an ASP:Literal on a master page.</p>
  
  <p>I have my content page as:</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="viewProduct.aspx.cs" Inherits="AlphaPackSite.viewProduct" Title="Hi there!" %&gt;
  &lt;%@ MasterType TypeName="Main" %&gt;
  </code></pre>
  
  <p>Then my master page called Main.master has:</p>
  
  <pre><code>&lt;asp:Literal runat="server" ID="lblBasket" /&gt;
  </code></pre>
  
  <p>But from the content page when I try and do:</p>
  
  <pre><code>Master.basket.Text = "test";
  </code></pre>
  
  <p>I get:</p>
  
  <blockquote>
    <p>Error 46 The type or namespace name
    'Main' could not be found (are you
    missing a using directive or an
    assembly reference?)</p>
  </blockquote>
  
  <p>The error is on the designer page:</p>
  
  <pre><code>public new Main Master {
      get {
          return ((Main)(base.Master));
      }
  }
  </code></pre>
  
  <p>My master page code behind is:</p>
  
  <pre><code>namespace AlphaPack.MasterPages
  {
      public partial class Main : System.Web.UI.MasterPage
      {
          protected void Page_Load(object sender, EventArgs e)
          {
              this.IsLoggedIn = Request.IsAuthenticated;
          }
  
          public bool IsLoggedIn
          {
              get { return this.ViewState["isLoggedIn"] as bool? ?? false; }
              set { this.ViewState["isLoggedIn"] = value; }
          }
      }
  }
  </code></pre>