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
1 answer

How to set path to Mono so Supervisor knows about it?

I am following this tutorial (Hosting Nancy with Nginx on Ubuntu) with one change. I am using the Spark view engine instead of the built in view engine. Spark view engine throws an error building any view when the Nancy host is running under…
Cogslave
  • 2,513
  • 3
  • 25
  • 35
0
votes
1 answer

How to organized page specific CSS link tags with spark view pages and application.spark

I'm currently using ASP.NET MVC 2 and the spark view engine. The main master page (application.spark) contains all of the CSS link tags that need to be present for all pages (global stuff). However, I have some content pages that have page…
dbr
  • 1
0
votes
1 answer

Spark engine conditional test

We use spark to generate HTML-mails. When merging our data into the template I noticed a difference between

You live in Belgium

You don't live in…

Jelle
  • 322
  • 3
  • 14
0
votes
1 answer

Can I create an isolated page in a project with spark masterpage setup?

Ive got a project that has got an application.spark and a html.spark that contains all the masterpage markup. The views work fine, but I need to create an isolated page that has no relation at all with the masterpages. Is it possible or will I need…
Ahmed
  • 3
  • 1
0
votes
1 answer

What to put in Spark SetPageBaseType setting

I use Spark to output some HTML straight from a console app. I have the following view classes in my project. //A shared view that all other views should use public abstract class SharedView : AbstractSparkView { public string BasePath =…
Riri
  • 11,501
  • 14
  • 63
  • 88
0
votes
1 answer

"The name 'Html' does not exist in the current context" exception

I'm rendering Spark templates in a console application and I'm trying to use RenderPartial like so: ${Html.RenderPartial("_mypartial.spark", myData)} but I'm getting this error when compiling the view: The name 'Html' does not exist in the current…
the_void
  • 5,512
  • 2
  • 28
  • 34
0
votes
1 answer

Spark View Engine and using viewdata confusion

I can't seem to get a grasp on how to use the viewdata structure in the spark view engine. I have the following code in my controller: // Retrieve the project list from the database var projects = from p in…
KallDrexx
  • 27,229
  • 33
  • 143
  • 254
0
votes
3 answers

HTML Helper checking if the date is MinValue

Can I configure the HTML Helper to display String.Empty if my date is MinValue? ${Html.TextBoxFor(v=>v.Date)} How can I do this?
Aline Bossi
  • 63
  • 1
  • 2
  • 5
0
votes
1 answer

Using asp.net site.master and spark views

Is it possible to use my site.master master page ? I want to start using Spark more, but this project I am working on is using asp.net view pages as well. I could of course convert the master page to an application.spark page, but I was wondering…
Morph
  • 1,719
  • 1
  • 18
  • 23
0
votes
1 answer

HtmlHelper to display only a few characters

Is it possible use a HtmlHelper to display only a few characters of the text? how can I do this?
0
votes
1 answer

Razor helper to Spark

hi there I'm having some trouble rewriting this code in spark, we have a website which uses both Spark and Razor, so when we do anything in razor it has to change in spark as well. I have been using macros for spark but it doesn't seem to work.…
0
votes
1 answer

Using Html.ActionLink() with ASP.NET MVC & Spark - Syntax?

All, Doing some experimenting with Spark and MVC within NerdDinner. The normal/aspx view works well, and I haven't touched any of the controller code so I'm pretty sure it's not that.
Sanjay Uttam
  • 786
  • 1
  • 7
  • 19
0
votes
1 answer

How can I make !{ } in SparkViewEngine not render anything?

How can I prevent the Spark view engine from rendering the debugging hint when a null ref exception is thrown in !{ }? It always renders "${ expression.that.throws.nre }". The documentation states that it should render an empty string... it never…
Charles
  • 6,199
  • 6
  • 50
  • 66
0
votes
1 answer

ASP.NET MVC1 - Not all Request fields being returned in Model... (NOOB question)

I'm working on my very first ASP.NET MVC project, and I'm seeing strange behavior when returning data from an Edit View to my controller action. Right now, I have 3 textboxes on the page, plus one hidden one for the PKey. All are being populated…
user257070
0
votes
2 answers

Are there any starter kits that uses all of : ASP.Net MVC 1.0 with Nhibernate. Sparkview, Jquery, Jquery UI?

I am looking for a starter kit that already is set up with the following? ASP.NET MVC 1.0 Jquery/Jquery UI/JqGrid/ Sparkview engine NHibernate Code quality is important as well. Thanks in advance.
Srikar Doddi
  • 15,499
  • 15
  • 65
  • 106