title: 'System.Web.Mvc.HtmlHelper' has no applicable method named 'Partial'
body: <p>I am getting this error:</p>
  
  <blockquote>
    <p>error CS1973: 'System.Web.Mvc.HtmlHelper' has no applicable
    method named 'Partial' but appears to have an extension method by that
    name. Extension methods cannot be dynamically dispatched. Consider
    casting the dynamic arguments or calling the extension method without
    the extension method syntax."}</p>
  </blockquote>
  
  <p>From what I read here <a href="https://stackoverflow.com/questions/4155392/razor-view-engine-an-expression-tree-may-not-contain-a-dynamic-operation">Razor View Engine : An expression tree may not contain a dynamic operation</a> is that it is due to using viewbag(?) which I am really using Session.</p>
  
  <p>This is my web form:</p>
  
  <pre><code>@using SuburbanCustPortal.MiscClasses
  
  @{
      ViewBag.Title = "Account Screen";
   }
  
  &lt;h2&gt;AccountScreen&lt;/h2&gt;
  
  &lt;div class="leftdiv"&gt;
    &lt;fieldset&gt;
      &lt;legend&gt;Customer Info&lt;/legend&gt;
      @Html.Partial("CustomerInfo")
    &lt;/fieldset&gt;
  
    &lt;fieldset&gt;
      &lt;legend&gt;Delivery Address&lt;/legend&gt;
      @Html.Partial("DeliveryAddress")
    &lt;/fieldset&gt;
  
    &lt;fieldset&gt;
      &lt;legend&gt;Delivery Info&lt;/legend&gt;
      @Html.Partial("DeliveryInfo")
    &lt;/fieldset&gt;
  &lt;/div&gt;
  
  &lt;div class="rightdiv"&gt;
    &lt;fieldset&gt; 
      &lt;legend&gt;Balance&lt;/legend&gt;
        @Html.Partial("AccountBalance")
    &lt;/fieldset&gt;
  
               @if (SessionHelper.ShowPaymentOptions || SessionHelper.ShowHistory)
               {
                 &lt;fieldset&gt;
                   &lt;legend&gt;Account Options&lt;/legend&gt;
                   &lt;br/&gt;
  
                   @using (Html.BeginForm("AccountScreenButton", "Customer", FormMethod.Post))
                   {
                     &lt;div class="sidebysidebuttons"&gt;
                       &lt;div class="box"&gt;
                         @if (SessionHelper.ShowHistory &amp;&amp; SessionHelper.ShowAccountScreenPaymentButton)
                         {
                           &lt;button class="sidebysidebutton1" name="options" value="payment"&gt;Make a Payment&lt;/button&gt;
                           &lt;button class="sidebysidebutton2" name="options" value="activity"&gt;Display Activity&lt;/button&gt;
                         }
                         else
                         {
                           if (SessionHelper.ShowAccountScreenPaymentButton)
                           {
                             &lt;button class="leftpaddedsinglebutton" name="options" value="payment"&gt;Make a Payment&lt;/button&gt;
                           }
  
                           if (SessionHelper.ShowHistory)
                           {
                             &lt;button class="leftpaddedsinglebutton" name="options" value="activity"&gt;Display Activity&lt;/button&gt;
                           }
                         }
                       &lt;/div&gt;
                     &lt;/div&gt;
                   }    
                 &lt;/fieldset&gt;
               }
  
    &lt;fieldset&gt; 
        &lt;legend&gt;Billing Info&lt;/legend&gt;
          @Html.Partial("BillingInfo", Model)
      &lt;/fieldset&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is part of my SessionHelper to give you an idea:</p>
  
  <pre><code>public static CustomerData CustomerSessionData
  {
    get
    {
      try
      {
        return (CustomerData) HttpContext.Current.Session["CustomerSessionData"];
      }
      catch (Exception)
      {
        return null;
      }
    }
    set { HttpContext.Current.Session["CustomerSessionData"] = value; }
  }
  
      public static bool ShowPaymentTab
      {
        get { return HttpContext.Current.Session["ShowPaymentTab"].ToBool(); }
        set { HttpContext.Current.Session["ShowPaymentTab"] = value; }
      }
  </code></pre>
  
  <p>I'm not sure were the issue is in the form since when I put a break point in the form, it does not stop there.</p>
  
  <p>I have two questions:</p>
  
  <ol>
  <li>How do I debug where the issue is on the form?</li>
  <li>Can I not use a class as a session and reference it in the form? I'm assuming that is where the issue is at.</li>
  </ol>