The client of a ASP.NET MVC3 project has a large number of static pages - think "pages" for WordPress blog, and they are linked to each other. I need to render the content of the page with a dynamic header and sidebar, so some of the excellent answwrs, such as this, does not apply in this case.
Right now, I have created a layout which re-use the common elements of each page and which will dyn开发者_如何学编程amically render menu depending on user's roles and permissions. I am thinking to
create an action for each static page, so the dynamic content and static content would be merged together. Each static page would be a partial view in the form of a cshtml OR
Make use of RenderPage, and include the url of the next page to include as a query (bad idea?). This way only one action is needed to render all the static pages which would be just cshtml.
I am trying to stay away from implementing any CMS-like capabilities as the static content is unlikely to change and the client will have their own programmers to update the page after launch.
You may want to consider creating a T4 template to automate the controller/action generation based on the files?
精彩评论