Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is RedirectToAction not redirecting?

Tags:

c#

asp.net-mvc

In a Action, I am calling

RedirectToAction("login", new { test = "1" });

And the page doesn't seem to be redirecting. The action "login" is in the same controller.

What could the issue be?

like image 801
mrblah Avatar asked Sep 09 '09 14:09

mrblah


2 Answers

You should use

return RedirectToAction(...
like image 111
Jan Jongboom Avatar answered Sep 22 '22 00:09

Jan Jongboom


RedirectToAction(... will not work if you are using AJAX form. ajax request simply ignore the redirect call

like image 21
jawahar Avatar answered Sep 21 '22 00:09

jawahar