mrblah
mrblah

Reputation: 103677

Why is RedirectToAction not redirecting?

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?

Upvotes: 8

Views: 1983

Answers (3)

jawahar
jawahar

Reputation: 41

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

Upvotes: 3

Muthukumar
Muthukumar

Reputation:

You have to use return the RedirectToAction.

Upvotes: 1

Jan Jongboom
Jan Jongboom

Reputation: 27342

You should use

return RedirectToAction(...

Upvotes: 23

Related Questions