I really like Spark, but we’ve already got a big investment in webforms based views. I’d like to start using Spark without having to convert all my existing views up front.
The only problem I have with getting Spark working side by side with webforms is the master pages. Currenly I have spark layouts that are 1 for 1 duplicates of the master pages.
This amount of duplication isn’t acceptable. I’ve already been bitten by it several times.
Is there any way to get spark views to work within a webforms master? Or for a webforms view to work within a spark layout? Either would solve the duplication problem.
The way I’ve accomplished this was to move most of the content of my master page into partial views, and then have two master pages: Foo.Master, and Foo.Master.spark that both use the same Html.RenderPartial() calls. Both masters have the same named content areas. This lets me use either engine for a given view and makes the duplication as small as possible.
An individual view engine is expected to handle both its master and view. The call to IViewEngine is:
It does not render the master separate from the view.
Spark uses this to compile the master into the view and other tricks with its multi-pass rendering.