title: MVC, how to post data to controller and redirect to aspx page
body: <p>I have an MVC view where user can set a flag and post data to controller (post because I want to hidden query string)</p>
  
  <p>After the controller have done his job I want to redirect to website home page that is an aspx page (my site is mixed aspx and MVC)</p>
  
  <p>Is there a way to do that?</p>
  
  <p>This is my view</p>
  
  <pre><code>@model MessaggiVM
  &lt;form role="form" class="form-inline" method="post" action="Messaggi/VaiAllaHome"&gt;
      &lt;button id="btnHome"&gt;Vai alla pagina iniziale&lt;/button&gt;
  
      &lt;div class="form-group"&gt;
          &lt;label for="nascondi"&gt;hiding&lt;/label&gt;
          &lt;input id="nascondi" type="checkbox" name="nascondi" value="true" /&gt;
      &lt;/div&gt;
      &lt;input type="hidden" name="elencoPost" value="@Model.Posts" /&gt;
      @*@Html.ActionLink("Messaggi", "VaiAllaHome", new { posts = Model.Posts} )*@
  &lt;/form&gt;
  </code></pre>
  
  <p>And this the controller</p>
  
  <pre><code>[HttpPost]
  public RedirectResult VaiAllaHome(bool? nascondi = false, IEnumerable&lt;Messaggio&gt; elencoPost = null)
  {
      // do something
  
      return Redirect(Url.Content("~/"));
  }
  </code></pre>
  
  <p>When I run this code controller action is executed without error but redirect is not done and browser remain on the view</p>
  
  <p>Other problem is that elencoPost parameter is empty in the action but I'm investigating it</p>
  
  <p>EDIT</p>
  
  <p>Honestly I'm thinking to post data on input change and switch button for a simply link</p>
  
  <p>EDIT 2:</p>
  
  <p>found the reason: in default.aspx i have a auto-redirect to Message page :(</p>