views:

223

answers:

2

Is it possible to use multiple view engines? I have a large(ish) site that is already using the webforms view engine, but we would like to move to spark for new features.

Is this supported? any documentation online that details how to do this?

+10  A: 

I use Spark and default view engine. There is not much to do. You have to register SparkViewFactory by calling ViewEngines.Engines.Add() and Spark will handle *.spark files and default view engine (WebFormViewEngine) will handle old views. Just don't remove webforms engine from ViewEngines.Engines list.

LukLed
+4  A: 

That's what I did; I installed Spark and did couple of views. Eventually I ended up with all views being .spark; no WebForms in the project. I think you can even use partials of one engine from different engine using RenderPartial (though I'm not sure); and of course RenderAction will work with any combination.

The process is very simple as described by LukLed; I just second his answer here so that you have more "success story" cases.

The only problem that you may find is that master pages are not compatible; you'll have to keep them in sync. You can find a question about this here.

queen3
You can use RenderPartial to render part of the page using other view engine. I did some views using Spark, but weak support for Resharper and RGreatEx extension drove me back to using default view engine.
LukLed