简体   繁体   中英

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.

您应该从母版页调用子操作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM