views:

296

answers:

1

I am in the process of converting views from ASP.NET MVC TagSoup to using Spark. However, I can't figure out if there is an analogue to ASP.NET Nested Masters in Spark layouts.

If this isn't there, would the best approach be to use partials?

+4  A: 

You can have nested master pages in Spark. Just put your master and sub master pages into the 'Layout' folder and then reference them by including <using master="foo"/>.

E.g.

(Application.spark)

<p>Hello World - Master</p>
<using:view/>

(SubMaster.spark)

<content:view><p>Hello World - SubMaster</p></content>
<using:view/>

(Foo.spark)

<using master="SubMaster"/>
<content:view><p>Hello World - Foo</p></content>

For more info see Master Layouts | Spark View Engine.

AdamRalph
Thanks, for some reason I don't get any output, but I'm probably doing something wrong.
FlySwat
You'll want to remove the <content:view>... The name view is the default output, so you can't capture into it.
loudej