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
6
votes
2 answers

HTML comments in Spark view engine

How can I comment out parts of a Spark view so they aren't rendered to the client? In aspx pages I can do this: <%-- server-side comment --%> I had thought using three dashes would work: but it doesn't work and I now…
roryf
  • 29,592
  • 16
  • 81
  • 103
5
votes
2 answers

How does Spark View Engine's performance compare to ASP.NET?

I'm interested in using Spark for an open source pet project of mine that runs with the asp.net mvc framework. I wonder if anyone has real experience with it and knows how it performs compared to the normal asp.net view engine? I know that…
kitsune
  • 11,516
  • 13
  • 57
  • 78
5
votes
2 answers

Can not render view in TinyWeb framework

I am trying to render a simple view with the TinyWeb framework and Spark view engine. Enviroment is Visual Studio 2011 developer preview & .net 4.5 Rendering a template with no model binding works fine. However when I bind a model then it no longer…
Cogslave
  • 2,513
  • 3
  • 25
  • 35
5
votes
2 answers

Using A Spark master layout with Razor view

I'm working on a project where Spark has been used as the View engine, and the decision has been made to switch to Razor. I have managed to get Razor and Spark working nicely side by side in one project. The only issue is when I create a Razor view…
Dan
  • 29,100
  • 43
  • 148
  • 207
5
votes
2 answers

Is the Spark ViewEngine compatible with Glimpse?

Just came across the glimpse tool (getglimpse.com) and would like to try it out on my Spark-powered site (VS2010, MVC3), but come unstuck at the first hurdle. When I run my site I get the following error: Unable to cast object of type…
kenxl
  • 319
  • 1
  • 4
  • 13
5
votes
3 answers

You need to build Spark before running this program error when running bin/pyspark

I am getting started with Spark. I am getting an issue when starting spark. I downloaded from spark official website, I am trying to quickstart from this https://spark.apache.org/docs/0.9.0/quick-start.html I have downloaded, setup sparkhome., and…
5
votes
5 answers

Spark-View-Engine with ASP.NET MVC2

How do you modify a ASP.NET MVC 2.0 project to work with the Spark View Engine? I tried like described here: http://dotnetslackers.com/articles/aspnet/installing-the-spark-view-engine-into-asp-net-mvc-2-preview-2.aspx But somehow it still tries to…
Ben
  • 2,560
  • 4
  • 29
  • 43
5
votes
1 answer

Spark View Engine If statement applied to attributes

Is there any better, cleaner, way to set selected="true" ? Maybe a nested if?