Is it possible to find out from which controller method the view is called?
1 answer
In the view, you can use the ViewContext
<p> Controller - @ViewContext.RouteData.GetRequiredString("controller") </p> <p> Action - @ViewContext.RouteData.GetRequiredString("action") </p> - The question is slightly different. The controller has a method that returns a view. I call this method from the same controller, but from another method. - Vivus
- Sorry). There is no difference. Thanks for the help. - Vivus
|