Categories
Uncategorized

How to install and configure SPARK view in MVC 3 using Visual Studio 2010

Step 1 : Download Spark View Engine from here

Step 2 : Add Reference to your MVC project

Now using the files downloaded, add the following dlls to your project


  • Spark.dll
  • Spark.Web.Mvc.dll

Step 3 : Add the following code to Application_Start in Global.asax file

protected void Application_Start(object sender, EventArgs e)  
{
var settings = new SparkSettings()
.SetDebug(true)
.AddNamespace("System")
.AddNamespace("System.Collections.Generic")
.AddNamespace("System.Linq")
.AddNamespace("System.Web.Mvc")
.AddNamespace("System.Web.Mvc.Html");
ViewEngines.Engines.Add(new SparkViewFactory(settings));  
}
Step 4 : Add a Spark View
There will not be an option to add a spark view. You will first need to add an .aspx or a razor view and then rename extension (.aspx//cshtml) of the view to .spark
AND that's it, your spark view is ready to go :D