I’m new to asp.net, Im posting all my data to server using $.post (Jquery syntax).
Action of controller is executed @ the end I’m calling RedirectToAction to different action method, after completion of action method execution.
Eecution reaches to completed callback event of $.Post() where im loading result of request in html to root element of page. $(html).html(results).
How can i use $.post with RedirectToAction
What’s the point of using AJAX when you replace the whole page? The whole point of AJAX is to refresh only a certain portion of the DOM. If you are going to refresh your entire page, then simply use a standard link, no need of AJAX. But if we suppose that your controller action handles 2 cases: one in which it returns a partial view and one in which it redirects, you could pass the target url as JSON:
and then on the client: