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

ASP.NET MVC View Engine Comparison

I've been searching on SO & Google for a breakdown of the various View Engines available for ASP.NET MVC, but haven't found much more than simple high-level descriptions of what a view engine is. I'm not necessarily looking for "best" or "fastest"…
mckamey
  • 17,359
  • 16
  • 83
  • 116
150
votes
9 answers

How do I get the collection of Model State Errors in ASP.NET MVC?

How do I get the collection of errors in a view? I don't want to use the Html Helper Validation Summary or Validation Message. Instead I want to check for errors and if any display them in specific format. Also on the input controls I want to check…
rmontgomery429
  • 14,660
  • 17
  • 61
  • 66
126
votes
11 answers

ASP.NET MVC partial views: input name prefixes

Suppose I have ViewModel like public class AnotherViewModel { public string Name { get; set; } } public class MyViewModel { public string Name { get; set; } public AnotherViewModel Child { get; set; } public AnotherViewModel Child2 {…
queen3
  • 15,333
  • 8
  • 64
  • 119
16
votes
5 answers

Using Spark View Engine in a stand alone application

My client application needs to generate HTML. I'd like to use a template/view engine solution like Spark, but I'm not sure whether Spark can be used outside of an ASP.NET application. Does anyone know of any samples or documentation about using…
dthrasher
  • 40,656
  • 34
  • 113
  • 139
14
votes
3 answers

Spark T4 templates for ASP.NET MVC

I was just curious if any Spark T4 templates already exist that match/are similar to the out of the box web forms view templates (create, edit, details, etc...). My Google skills didn't lead me to any results.
Chris
  • 4,393
  • 1
  • 27
  • 33
13
votes
3 answers

ASP.NET MVC Spark view engine

What pros(positive sides) of using Spark view engine for ASP.NET MVC project. Why it better then default view engine?
Maksim Kondratyuk
  • 1,379
  • 16
  • 27
13
votes
7 answers

ASP.NET MVC Email

Is their a solution to generate an email template using an ASP.NET MVC View without having to jump through hoops. Let me elaborate jumping through hoops. var fakeContext = new HttpContext(HttpContext.Current.Request, fakeResponse); var oldContext =…
Andrew
  • 3,524
  • 5
  • 35
  • 50
12
votes
3 answers

Creating a 'website builder' - How would I architect it?

I've been tasked with adding a website builder to our suite of applications. Most of our clients are non technical small business owners (brick and mortar stores, mom and pop shops). I've been told that I should be looking at Blogger Template Editor…
Abdullah Ahmed
  • 500
  • 1
  • 6
  • 15
12
votes
5 answers

To Spark or not to Spark?

Been on a huge learning binge with ASP.MVC 2 lately, and recently uncovered there are different rendering engines out there... Spark especially caught my attention, couple of things though. I have vast knowledge with ASP.NET so is it worth the…
emalamisura
  • 2,816
  • 2
  • 29
  • 34
11
votes
5 answers

Simple ASP.NET MVC views without writing a controller

We're building a site that will have very minimal code, it's mostly just going to be a bunch of static pages served up. I know over time that will change and we'll want to swap in more dynamic information, so I've decided to go ahead and build a…
Jake Stevenson
  • 3,009
  • 6
  • 35
  • 40
10
votes
2 answers

ASP.NET MVC View Engine Resolution Sequence

I created a simple ASP.NET MVC version 1.0 application. I have a ProductController which has one action Index. In the view, I created a corresponding Index.aspx under Product subfolder. Then I referenced the Spark dll and created Index.spark under…
intangible02
  • 993
  • 1
  • 9
  • 19
9
votes
6 answers

Using asp.net mvc 2 features with the spark view engine

I am working with an ASP.NET MVC project which was originally started from the CodeBetter.Canvas project - and I'm trying to move to ASP.NET MVC 2. I successfully upgraded my project using Eilon's upgrade tool, moved to VS2010 (although not yet to…
Ian Robinson
  • 16,892
  • 8
  • 47
  • 61
8
votes
1 answer

How to stop Spark View Engine HTML encoding?

Even with the following in spark section of web.config: Things between ${...} Still get passed through H(...), which HTML encodes it. How change this or should I just fall back to !{...}?
Norbert B.
  • 5,650
  • 3
  • 25
  • 30
7
votes
2 answers

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?
Joel Martinez
  • 46,929
  • 26
  • 130
  • 185
6
votes
4 answers

alternative asp.net MVC view engines

I was wondering if there was a general consensus on the "best" alternative view engine for asp.net MVC. So far I know of Spark, Brail, NHaml but what about others?
codette
  • 12,343
  • 9
  • 37
  • 38
1
2 3
14 15