如何正确地重定向到控制器中的其他操作?当在下面的代码中调用redirecttoaction时,代码不会分支到“Javascript”操作。我错过了什么?谢谢!
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
});
}
答案 0 :(得分:1)
你需要回复:
if (formCollection["sxgenre"] == "Mobile")
{
return RedirectToAction(
"Javascript",
new
{
uid = uid,
release = release,
localization = localization,
label = label,
sessionid = sessionid
});
}