Questions tagged [spark-view-engine]

Spark is a view engine for ASP.NET MVC, Castle Project MonoRail, FubuMVC, NancyFx, JessicaFx and OpenRasta frameworks. The idea is to allow the html to dominate the flow and the code to fit seamlessly.

Based on the readme from the SparkViewEngine github page you can use two kinds of syntaxes

<viewdata products="IEnumerable[[Product]]"/>
<ul if="products.Any()">
  <li each="var p in products">${p.Name}</li>
</ul>
<else>
  <p>No products available</p>
</else>

or "left-offset" syntax inspired by frameworks like Jade and Haml

viewdata products="IEnumerable[[Product]]"
ul if="products.Any()"
  li each="var p in products" 
    ${p.Name}
else
  p |No products available
218 questions
0
votes
3 answers

MVC Ajax PartialViews not firing Javascript - should I use Spark?

I'm using MVC 2 and the default view engine to return .ascx partial views using the JQuery Ajax .get() method. The partial views have some javascript in them and I'm finding that the behaviour of the javascript is erratic in that sometimes it…
Click Ahead
  • 2,782
  • 6
  • 35
  • 60
0
votes
1 answer

Dynamically set the view base type for a partial view?

Is it possible to dynamically set the view base type for a partial view? I'm doing a lot of dynamic page generation, using custom IViewFolder and IViewFile implementations, and need to set a specific base type for certain views...it's not a…
Kieron
  • 26,748
  • 16
  • 78
  • 122
0
votes
1 answer

can spark inherit a regular master page

I have an existing mvc app. I've decided that i would like to use spark. My plan is to slowly migrate the whole site to spark. Will i have to create 2 master pages, ie one for .aspx content and one for .spark content. Is there anyway i could use one…
frosty
  • 5,330
  • 18
  • 85
  • 122
0
votes
1 answer

Spark view engine - named content ignored with RenderAction

Application.spark: Index.spark: # Html.RenderAction("Hello"); // This renders _Hello.spark _Hello.spark:
Alice
  • 909
  • 1
  • 11
  • 15
0
votes
1 answer

Spark Macro error (The name Html doesn't exists in current context)

We are working in a project where Spark view engine has been used. We are updating the framework and version of the project. After updating the version we are getting error "The name Html doesn't exists in current context" only in those .spark files…
Debajit Mukhopadhyay
  • 4,072
  • 1
  • 17
  • 22
0
votes
1 answer

why spark files not included in publishe folder?

I tried file system publish and ftp I'm using VS2010 and .net 4.0 should i somehow include *.spark ext files to the MSBuild?
Sasha
  • 20,424
  • 9
  • 40
  • 57
0
votes
1 answer

Error in installing spark view engine

I found a similar question here. I tried that solution of the accepted answer. No luck for me. I tried by running this command through Package manager console Install-Package Spark.Web.Mvc4 It gives the following error PM> Install-Package…
shanmugharaj
  • 3,814
  • 7
  • 42
  • 70
0
votes
3 answers

Using #DEBUG macros in spark

I have some scripts which need to be included only in the release version. Stuff like google analytics, quantserve etc. The typical way in asp.net mvc world is to wrap a #if DEBUG #endif How do I do it the sparkish way. Like