davethecoder
davethecoder

Reputation: 3932

working with multiple contentplaceholders in MVC

hi i have a master page in MVC with multiple contentplaceholders for example:

news list, basket preview, offers etc. and these things i want to be throughout the application, but this is my first MVC application and i was wondering if you guys have some sound advice on how to tackle multiple content, from multiple (pages/code) without having to reproduce code for each controller.

i have been trying to ge my head around the views, and maybe having each section as a view so viewnews would have contentplaceholderid="newsholder" etc but i dont know if this is the way to go, or how to impliment this in the controller as i will still want this on the url of say /product/1

anyway look forward to your response

thanks

Upvotes: 0

Views: 263

Answers (1)

Greg B
Greg B

Reputation: 14898

ContentPlaceholders are for stuff you want to be able to replace on 99% of your pages.

If you want semi-generic content accross several pages you want to look into UserControls and Html.RenderPartial (I'll try to find a better link).

Upvotes: 1

Related Questions