title: MVC 3 Posting form from partial view
body: <p>I can't figure out what I am doing wrong, I have a form in a partial view inside a layout and I can't get the controller to fire when the form is submitted, the form just posts to the localhost:54719/FormController/ExecutePost with the error </p>
  
  <pre><code>The controller for path &amp;#39;/FormController/ExecutePost&amp;#39; was not found or does not implement IController.
  </code></pre>
  
  <p>Layout Code : ~/Views/Shared/_Layout.cshtml</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;
          @ViewBag.PageTitle
      &lt;/title&gt;
      &lt;link rel="stylesheet" media="all" href="/Content/style.css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
      @Html.Partial("_Header");
      &lt;!-- / header --&gt;
      @Html.Action("Header", "Menu")
      &lt;!-- / navigation --&gt;
      @Html.Partial("_Form");
   &lt;!--Form --&gt;
      &lt;div id="body"&gt;
          @RenderBody();
      &lt;/div&gt;
      &lt;!-- / body --&gt;
      @Html.Partial("_Footer")
      &lt;!-- / footer --&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"&gt;&lt;/script&gt;    
      &lt;script src="/Content/js/plugins.js"&gt;&lt;/script&gt;
      &lt;script src="/Content/js/main.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Form code : ~/Views/Shared/_Form.cshtml</p>
  
  <pre><code>@model MathsDoctor.Models.FormModel
  
  @using (Html.BeginForm("ExecutePost", "FormController", FormMethod.Post))
  {
  
  &lt;div class="form" id="find-form"&gt;
      &lt;fieldset&gt;&lt;label&gt;Telephone:&lt;/label&gt;
          @Html.TextBoxFor(model =&gt; model.Telephone)
          @Html.ValidationMessageFor(model =&gt; model.Telephone)
      &lt;/fieldset&gt;
      &lt;fieldset&gt;&lt;label&gt;Name:&lt;/label&gt;
          @Html.TextBoxFor(model =&gt; model.Name)
          @Html.ValidationMessageFor(model =&gt; model.Name)
      &lt;/fieldset&gt;
      &lt;fieldset&gt;&lt;label&gt;Postcode:&lt;/label&gt;
          @Html.TextBoxFor(model =&gt; model.Postcode)
          @Html.ValidationMessageFor(model =&gt; model.Postcode)
      &lt;/fieldset&gt;
      &lt;fieldset&gt;&lt;input type="submit" value="SUBMIT"&gt;
      &lt;/fieldset&gt;
  &lt;/div&gt;
  }
  </code></pre>
  
  <p>Form Controller : ~/Controllers/FormController.cs</p>
  
  <pre><code>public class FormController : Controller
  {
      //
      // GET: /FindTutorForm/
  
      [HttpPost]
      public ActionResult ExecutePost(Models.FormModel formModel)
      {
          if (ModelState.IsValid)
          {
              return Redirect("/thanks/");
          }
  
          return PartialView("~/Views/Shared/_Form.cshtml");
  
      }
  }
  </code></pre>
  
  <p>I am sure I have missed something really simple... </p>