Is it possible to have a master page that has a renderpartial it in and supply a value to be passed to that partial before it is rendered.
For example we have a common menu structure across our site, I would like to put this as a partial in the master page, the problem comes in that depending on what area in the page you are we need to set a value for the selected tab so it gets highlighted and you can see where you are.
Currently the render partial is on ever page and passes in a value for the selected tab, I would like this to be in the master page and just have some way to pass the value to the master page.
I have a feeling this might be possible with the changes introduced with razor but I’m not sure, in any case we are using asp.net mvc 2 (although I’m still interested in things that would apply to more recent versions)
You could use RouteData property to get currently called page using the following:
Either in the controller associated with the menu or in the view itself (if it’s partial). Then you can filter the output upon the current route.