| Home |
| About me |
| My CV |
| Hobbies |
| Professional Experiences |
| Projects |
| Computer skills |
| My Gentoo Overlay |
| Gallery |
| Personal gallery |
| Guestbook |
| Contact me |
| Gentoo |
| *nix |
| Programming |
| Softwares |
| Misc |
| ASP.NET MVC3 jQuery form POST and Redirect |
It has been some time since I touched ASP and M$ stuff. Today while working with ASP.NET and jQueryMobile, I discovered that my redirection no longer worked. If you have a form POST to an action that return a Redirect like:
[HttpPost] public ActionResult Reserve(ReserveViewModel reserveViewModel) { .... return Redirect(redirectUrl); }
ISS will return an HTTP 302 redirection, in order for jQuery to redirect to that URL instead of using AJAX to handle. Your form must have an data-ajax="false", like:
<form action="/Ticket/Reserve" data-ajax="false" method="post"> .... </form>
That will disable AJAX handling on that form and your browser will happily redirect to the new address. Last update: 26-11-2011 10:34
|
No comment posted
| Next > |
|---|