Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mixing spark and webform view engines

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?

like image 534
Joel Martinez Avatar asked Feb 05 '10 20:02

Joel Martinez


2 Answers

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.

like image 78
LukLed Avatar answered Nov 20 '22 13:11

LukLed


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.

like image 33
queen3 Avatar answered Nov 20 '22 12:11

queen3