Pass data to child action's view

511 views Asked by At

I have multiple views which call the same child action, which renders a view.
Depending on which view calls the child action, I want to display a different message in the childview. But since I don't need this view inside the child action's controller method, I feel passing it along as a controller parameter is not a very nice solution.

I tried ViewData, which doesn't work -- it gets emptied for the child call
I currently use TempData, which works but not very nice, since it uses session for no real reason

Is there any other option than these three?
(it should also work in MVC2, please)

0

There are 0 answers