Razor Nested Layouts with Cascading Sections

前端 未结 4 1943
一向
一向 2020-12-12 23:34

I have an MVC3 site using Razor as its view engine. I want my site to be skinnable. Most of the possible skins are similar enough that they can derive from a shared master

4条回答
  •  被撕碎了的回忆
    2020-12-13 00:01

    This is in fact not possible today using the public API (other than using the section redefinition approach). You might have some luck using private reflection but that of course is a fragile approach. We will look into making this scenario easier in the next version of Razor.

    In the meantime, here's a couple of blog posts I've written on the subject:

    • http://blogs.msdn.com/b/marcinon/archive/2010/12/08/optional-razor-sections-with-default-content.aspx
    • http://blogs.msdn.com/b/marcinon/archive/2010/12/15/razor-nested-layouts-and-redefined-sections.aspx

提交回复
热议问题