title: MVC3 @Model becomes null in layout
body: <p>So I have something odd happening in a MVC3 layout I created.  It's strongly typed to BaseVM.  Every View model inherits from BaseVM.  When I debug and step through the code and it it steps through my layout, the BaseVM model is not null and it calls a method to get the current year for the copyright in the footer.  But as soon as I step to the bottom of the layout, it throws an exception back up where I was calling the property to get the year and suddenly the Model is null.  Now this doesn't cause the application to show an error screen or message, but this exception gets logged every time the page is loaded.  Here's a code sample:</p>
  
  <pre><code>public class BaseVM
  {
      public string CurrentYear
      {
          get
          {
              return DateTime.Today.Year.ToString();
          }
      }
  
      public BaseVM()
      {
      }
  }
  
  public class PrelaunchReserveVM : BaseVM
  {
      public PrelaunchDTO Prelaunch { get; set; }
  
      public PrelaunchReserveVM()
          : this(new PrelaunchDTO()) { }
  
      public PrelaunchReserveVM(PrelaunchDTO prelaunch)
          : base()
      {
          this.Prelaunch = prelaunch;
      }
  }
  </code></pre>
  
  <p>The action in the controller:</p>
  
  <pre><code>public ActionResult Reserve()
  {
      return View("Reserve", new PrelaunchReserveVM(new PrelaunchDTO()));
  }
  </code></pre>
  
  <p>The layout:</p>
  
  <pre><code>@model StickyThink.Models.VM.BaseVM
  </code></pre>
  
  <p>
      ...
  
  </p>
  
  <pre><code>&lt;div id="container"&gt;
      &lt;div id="main" role="main" style="padding: 0px; margin: 0px;"&gt;
          @RenderBody()
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;footer&gt;
      &lt;div id="FooterPageContainer" class="center"&gt;
          Copyright &amp;copy @Model.CurrentYear ...  All rights reserved.
      &lt;/div&gt;
  &lt;/footer&gt;
  &lt;!-- END: Add your site or application content here --&gt;
  @Html.Partial("_Scripts")
  @RenderSection("scripts", false);
  </code></pre>
  
  <p>
  </p>
  
  <p>So it steps into @Model.CurrentYear and model is not null.  Then it steps down to @RenderSection (to render some scripts from the view) and then an exception is thrown and @Model is null.  Thoughts?</p>