tags:

views:

17

answers:

1

I'm using Html.RenderAction, in ASP.NET MVC (futures), to display modules on different pages. I want the modules to be aware of which page they belong to (for settings and logging purposes).

Is there a way to get the Controller/Action - stack, on the current controller?

I found on the Controller base something called DescriptorCache under ActionInvoker and that has something called Cache wich has that info, however I do not have access to that in the Controller because it's defined as private.

Appreciate your help :m

+1  A: 

Can you? Yeah. Should you? Hell no. If you need to conditionally render, put the data into the view's model. Don't try to use the call stack as part of your view model!

Craig Stuntz
Well, the thing is that I do not want to use this information in the view itself. I am talking about the controller for the "sub-view" that gets called by the Html.RenderAction method.The situation is as follows; I have moduels that get placed on different pages, then the modules need to know what page they belong to.I do know that this info can be put into the view model for the modules, but I want to make them as self contained as possible and therefore have them pick up where they are placed.
iammaz