Is is possible to do a post from an Action "Save" in a controller "Product" to an Action "SaveAll" in a controller "Category"??
And also passing a FormCollection as parameter
To redirect the user to another action method from the controller action method, we can use RedirectToAction method. Above action method will simply redirect the user to Create action method.
I'm assuming you want to return that action's result. var ctrl= new MyController(); ctrl. ControllerContext = ControllerContext; //call action return ctrl. Action();
Put the following code in your Product
controller:
return RedirectToAction("SaveAll", "Category")
Here, "SaveAll"
is an Action Name and "Category"
is Controller Name.
The user will then be redirected to the SaveAll
action (i.e., the method will be called).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With