.NET MVC Call method on different controller

前端 未结 7 1398
Happy的楠姐
Happy的楠姐 2020-11-30 06:26

Can anybody tell me how to call a method on a different controller from within an action method? I don\'t want to redirect. I want to call a method on a different controller

7条回答
  •  迷失自我
    2020-11-30 07:02

    Looks like you're trying to do something the controllers aren't designed for. Design your required method as an public method in some class and invoke from both controller actions.

提交回复
热议问题