MVC ActionLink not working after submit

These past days, I was having a problem with links for an iPad web app. The problem was that when I submit a form (step 1) and go to the next form (step 2), the link to return back to step 1 was not working. Apparently the problem is caused by Ajax. The solution is the following, instead of using the normal form tag to init a form:

      ……

use this type of form initialiser

@using (Html.BeginForm(“action”, “controller”, FormMethod.Post))
{

      ……

}

And add the following attribute:

{ “data-ajax”, “false” }

So the final code would look like this:

@using (Html.BeginForm(“action”, “controller”, FormMethod.Post, new Dictionary { { “data-ajax”, “false” } }))
{
……

}

Hope this post helps you, and reduces your swearing 🙂 Happy Form-ing!

 

 

 

Categories

No Responses

Leave a Reply

Your email address will not be published. Required fields are marked *