我需要从控制器 A 调用控制器 B 操作 FileUploadMsgView 并需要为其传递一个参数。
它不会去控制器 B 的FileUploadMsgView()
。
这是代码:
控制器A:
private void Test()
{
try
{ //some codes here
ViewBag.FileUploadMsg = "File uploaded successfully.";
ViewBag.FileUploadFlag = "2";
RedirectToAction("B", "FileUploadMsgView", new { FileUploadMsg = "File uploaded successfully" });
}
}
ControllerB(接收部分):
public ActionResult FileUploadMsgView(string FileUploadMsg)
{
return View();
}