문제

I have tried using the ControllerContext object, but I don't know how to instantiate it. I'd like to remind you that I'm trying to get the controller name in a custom class outside a view or a controller. Thanks,

도움이 되었습니까?

해결책

Don't do this. Simply pass the controller name as parameter from within the controller to whatever class needs it. Current controller is a notion that doesn't make sense from outside of a controller.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top