Puzzle84
Puzzle84

Reputation: 540

how to render a partial view on the masterpage

Alright so here is the question.

I have a user class which contains a list of users named Friends. I wish to show a list of friends in the right collumn on all my pages.

so i created a 3 collumn layout as a masterpage. and in this friends column i RenderPartial("Friends");

Sadly this needs a model. How can i access my DOCCL.Models.User class and loop through it's Friends in the friends list?

I don't understand how i can create a controller for this as my masterpage is not strongly typed.

Upvotes: 0

Views: 1621

Answers (1)

SLaks
SLaks

Reputation: 887405

You should call a child action from the master page.

Upvotes: 3

Related Questions