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

Using a different viewmodel in partial view using Spark view engine

Using ASP.NET MVC & Spark, I have a view that is listing a number of searches. The view has the following declaration at the top: On the same search page, I also render a partial which is used as the…
Martin
  • 43
  • 3
4
votes
4 answers

Setting the Checked property of a CheckBox in ASP.NET MVC

I'm trying to work around the lack of a CheckBoxList in ASP.NET MVC. I've gotten to the point I can render a list of Enum values just fine, but I'm stuck on how to set the checked attribute based on my Model - Which in this case is a User entity…
Michael Cook
  • 1,676
  • 2
  • 26
  • 47
4
votes
0 answers

ASPX View Engine

So the Razor view engine is open source and can be used outside MVC specific implimentations. However, for my specific project (Where I want to enable this functionality inside WordprocessingML Razor won't work as it tries to be smart and work out…
Gineer
  • 2,358
  • 4
  • 26
  • 40
3
votes
2 answers

ASP MVC JsonResult renders as page instead of being captured by calling jQuery function

I'm having some problems with getting a JSON response from an ASP MVC controller method to be processed within jQuery - something that I've tried before without a problem - however I've obviously done something wrong this time and I can't figure out…
Ian Cotterill
  • 1,667
  • 4
  • 18
  • 28
3
votes
2 answers

Migrating from Spark to Razor

We are gradually migrating a Spark based project to use Razor and I have come across something I can't seem to find an answer to. My line in my Spark master calls a sub View like so