I\'m working on setting up a shared content (navigation) for an asp.net MVC layout page.
Here is my partial view \"_LayoutPartial.cshtml\" with code to pull navigati
I know this is an old question but I thought I would throw this in here. You can use either Html.Action
or Html.RenderAction
. They both technically do the same thing but depending on how much content you're returning back can have an impact on which one you should really use for best efficiency.
Both of the methods allow you to call into an action method from a view and output the results of the action in place within the view. The difference between the two is that
Html.RenderAction
will render the result directly to the Response (which is more efficient if the action returns a large amount of HTML) whereasHtml.Action
returns a string with the result.
Source