title: When using Html.Action in layout getting error: Child actions are not allowed to perform redirect actions
body: <p>I'll try to keep this as brief as possible.. I have a <code>ViewResult</code> that I am rendering on my _layout.cshtml page. This ViewResult is in a controller called CommonController where I am keeping some actions and data that I need on every page. If it matters, my <code>ViewResult</code> is a simple form.</p>
  
  <p><strong>ViewResult and the CommonController</strong></p>
  
  <pre><code>[Authorize]
  public class CommonController : AuthenticatedBaseController
  {
      [ChildActionOnly]
      public ViewResult OrgSwitch()
      {
          //do stuff
          return View();
      }
  
      [HttpPost]
      public RedirectToRouteResult OrgSwitch(string UserOrgs)
      {
          return RedirectToAction("Index", "Recruiter", new { orgId = UserOrgs, area = "InkScroll" });
      }
  }
  </code></pre>
  
  <p>In my _Layout.cshtml page I render it like so:</p>
  
  <pre><code>@Html.Action("OrgSwitch", new { controller = "Common", area = "MyArea" })
  </code></pre>
  
  <p>This is all working fine, but now I am adding some functionality elsewhere in the app. I had asp.net mvc5 scaffold out a controller and views for a class I need to CRUD against. Just the quick and dirty forms so I can test a couple of things. I am going into the create page to add a new item. <strong>warning, it is mvc scaffolding, very ugly</strong>:</p>
  
  <pre><code>@model inkScroll.Models.Vacancy
  
  @{
      ViewBag.Title = "Create";
  }
  
  &lt;h2&gt;Create&lt;/h2&gt;
  
  @using (Html.BeginForm()) 
  {
  @Html.AntiForgeryToken()
  
  &lt;div class="form-horizontal"&gt;
      &lt;h4&gt;Vacancy&lt;/h4&gt;
      &lt;hr /&gt;
      @Html.ValidationSummary(true)
  
      &lt;div class="form-group"&gt;
          @Html.LabelFor(model =&gt; model.JobRef, new { @class = "control-label col-md-2" })
          &lt;div class="col-md-10"&gt;
              @Html.EditorFor(model =&gt; model.JobRef)
              @Html.ValidationMessageFor(model =&gt; model.JobRef)
          &lt;/div&gt;
      &lt;/div&gt;
      // lots more ugly code
      &lt;div class="form-group"&gt;
          &lt;div class="col-md-offset-2 col-md-10"&gt;
              &lt;input type="submit" value="Create" class="btn btn-default" /&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  }
  </code></pre>
  
  <p>When I click 'submit' in the controller it does the usually validation checks and stuff. If my form <strong>is valid</strong>, there is no problem. If there are modelstate issues, I get the child action error. </p>
  
  <p>Any ideas?</p>
  
  <p><strong>EDIT</strong> to clarify, the razor page you see is a scaffolded page that posts to a seperate <code>JobsController</code>. The data being passed into the post of the 'create' page is working fine, I am only getting the error if the model validation fails.</p>