Skip to main content
deleted 68 characters in body; edited tags
Source Link
Himanshu
  • 32.8k
  • 32
  • 117
  • 137

I need to call a controller B action FileUploadMsgView from Controller A and need to pass a parameter for it.

Its not going to the controller B's FileUploadMsgView().

Here's the code:

ControllerA:

 Code---its not going to the controller B's FileUploadMsgView(). In ControllerA private void Test()  {   try   { {//some codes here   ViewBag.FileUploadMsg = "File uploaded successfully.";   ViewBag.FileUploadFlag = "2";     RedirectToAction("B", "FileUploadMsgView", new { FileUploadMsg = "File uploaded successfully" });   }    In ControllerB receiving part}  

ControllerB (receiving part):

public ActionResult FileUploadMsgView(string FileUploadMsg)  {   return View();  } 

I need to call a controller B action FileUploadMsgView from Controller A and need to pass a parameter for it.

 Code---its not going to the controller B's FileUploadMsgView(). In ControllerA private void Test()  {   try   {//some codes here   ViewBag.FileUploadMsg = "File uploaded successfully.";   ViewBag.FileUploadFlag = "2";     RedirectToAction("B", "FileUploadMsgView", new { FileUploadMsg = "File uploaded successfully" });   }    In ControllerB receiving part  public ActionResult FileUploadMsgView(string FileUploadMsg)  {   return View();  } 

I need to call a controller B action FileUploadMsgView from Controller A and need to pass a parameter for it.

Its not going to the controller B's FileUploadMsgView().

Here's the code:

ControllerA:

private void Test() { try { //some codes here ViewBag.FileUploadMsg = "File uploaded successfully."; ViewBag.FileUploadFlag = "2"; RedirectToAction("B", "FileUploadMsgView", new { FileUploadMsg = "File uploaded successfully" }); } } 

ControllerB (receiving part):

public ActionResult FileUploadMsgView(string FileUploadMsg) { return View(); } 
edited tags
Link
tereško
  • 58.5k
  • 26
  • 100
  • 151
Source Link
user2156088
  • 2.5k
  • 6
  • 22
  • 24
Loading