Razor Nested Layouts with Cascading Sections

前端 未结 4 1940
一向
一向 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-12 23:54

    @helper ForwardSection( string section )
    {
       if (IsSectionDefined(section))
       {
           DefineSection(section, () => Write(RenderSection(section)));
       }
    }
    

    Would this do the job ?

提交回复
热议问题