.NET MVC - Call a controller Action from another controller action

前端 未结 2 2051
春和景丽
春和景丽 2021-01-03 18:54

I have a controller action which I would like to call another controller action.

Is this a valid thing to do. Is it possible?

相关标签:
2条回答
  • 2021-01-03 19:03

    As @Justice says you can use RedirectToAction. Also, you can use TempData to pass model (and other) data between controller actions.

    0 讨论(0)
  • 2021-01-03 19:19

    Controller.RedirectToAction

    0 讨论(0)
提交回复
热议问题