Reputation: 19684
How do I redirect to another action in my controller correctly? When the redirecttoaction is called in the code below the code does not branch to the "Javascript" action. What am I missing? Thanks!
public ActionResult Build(
string uid,
string release,
string localization,
string label,
string sessionid,
FormCollection formCollection)
{
if (!FormValid(uid, release)) return Index();
if (formCollection["sxgenre"] == "Mobile")
{
RedirectToAction("Javascript",
new
{
uid = uid,
release = release,
localization = localization,
label = label,
sessionid = sessionid
});
}
Upvotes: 0
Views: 639
Reputation: 1039428
You need to return:
if (formCollection["sxgenre"] == "Mobile")
{
return RedirectToAction(
"Javascript",
new
{
uid = uid,
release = release,
localization = localization,
label = label,
sessionid = sessionid
});
}
Upvotes: 1