I call with ajax to NameController\Action
In this action i return ActionResult – a View(model)
Is there any way I can redirect the client to the returned view?
Now I see this view only in the fiddeler (as returned content)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Of course, but why are you using AJAX in this case? The whole point of AJAX is to stay on the same page and avoid reloading the entire HTML.
But if you want you could achieve that. For example you could have the controller action conditionally return a JSON result containing the target url you want to redirect to. And then inside the success callback of the AJAX call use the
window.location.hrefto perform the redirect on the client.Let’s exemplify:
and then inside your AJAX success callback: