I can do this using Get and RedirectToAction, but wonder why I cant do it using Post? I'm in the Subscriber controller and want to return a view from the CreateTest controller. When it returns, it assumes I'm still in Subscriber and doesn't look in the Controller views.
public class SubscriberController : Controller
{
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult CreateTestPortal()
{
CreateTestController ctc = new CreateTestController();
return ctc.CreateTestPortal();
}
}
public class CreateTestController : Controller
{
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult CreateTestPortal()
{
//... validation logic
var vm = new CBT.Models.CreateTest.CreateTestPortal();
//... build form logic
return View(vm);
}
}
If I make this call from the CreateTestPortal in Subscriber,
return RedirectToAction("CreateTestPortal", "CreateTest");
It returns the form correctly, but I have to use the GET method and lose the security of the ValidateAntiForgeryToken. Is this default behavior or am I missing a step.
I'm using MVC4