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

SparkViewEngine: Is there a functionality available that's equivalent to a PHP Include?

I am using the SparkViewEngine with ASP.NET MVC 1.0 and was wondering if there is a way to include another View within your current view. For example, I have this view called ResourceManager.spark. Inside this file, I want to include another…
Abe
  • 6,386
  • 12
  • 46
  • 75
0
votes
1 answer

Trouble with MVCContrib InputForm and SparkViewEngine

I am trying to use MVCContrib InputBuilders but I am having trouble. I am also using S#arp architecture and spark. My spark view looks like this: new.spark: ${Html.InputForm()} My…
Chris Nicola
  • 14,384
  • 6
  • 47
  • 61
0
votes
1 answer

How can I render a html page using spark and MVC?

I'm trying to render a plain html view using Spark and MVC but I obtain the following error: The view 'Principal.html' or its master could not be found. The following locations were searched: ~/Views/Site/Principal.html.aspx…
Cintia
  • 1
  • 2
0
votes
1 answer

sparkviewengine alternative for WebForms project

I like the html dominated structure of the sparkviewengine very much. Is there a version of it for WebForms projects? I want to use it for generating presentation only html (I mean, the output will not contain any html input controls). Or can you…
hazimdikenli
  • 5,709
  • 8
  • 37
  • 67
0
votes
2 answers

SparkViewEngine, RenderAction and Areas with ASP MVC 2 Beta?

I just ran into trouble with the AreaDescriptionFilter of Spark using MVC 2 Beta. The following line is from my Application.spark file. It results in the view engine looking in all possible locations of the view - except in the folders of the area…
0
votes
1 answer

Passing potential nulls to Macros in Spark view engine

I have the following macro: ...
Sean Chambers
  • 8,572
  • 7
  • 41
  • 55
0
votes
2 answers

Handling empty collections in view model with spark

In spark when sending a view model to the view when a collection is empty is causing me some headaches like so: Where "model.addresses" may be empty and thus gives an NRE. Is there anyway to handle this…
Sean Chambers
  • 8,572
  • 7
  • 41
  • 55
0
votes
1 answer

In ASP.NET MVC with Spark View Engine on form submisison error why am I getting a 404 resource not found?

My view: /User/EditUserName/2/me
!{Html.TextBox("newUserName")}
rball
  • 6,925
  • 7
  • 49
  • 77
0
votes
1 answer

MVC Contrib Input Builders and Spark View Engine

In Eric Hexter's Input Builders, different templates use different strongly-typed models; for example String uses PropertyViewModel, DateTime uses PropertyViewModel, Form uses PropertyViewModel[], and so forth. Spark View Engine…
Daniel Liuzzi
  • 16,807
  • 8
  • 52
  • 57
0
votes
1 answer

Cannot use fluent html lambda expressions in Spark view

I'm attempting to use fluent html and the spark view engine in my asp.net mvc application. I've assinged the proper base class, added the assemblies, and when i do this.TextBox("MyProperty") it works fine. However I get the below exception when i…
midas06
  • 1,991
  • 2
  • 22
  • 43
0
votes
1 answer

Getting at ViewData.Model from spark template post

I am trying to convert my spark views to use ViewData.Model instead of the namevaluecollection so that I can use AutoMapper to map my dto's to entities before it gets into my action method. I can access the viewdata.model from the view, but upon…
Sean Chambers
  • 8,572
  • 7
  • 41
  • 55
0
votes
1 answer

spark view engine Precompilation and extension methods

In our web project we have added Extension methods in a folder \Code\Extensions\DateTimeExtension.cs containing an extension method called FromUtcToUserTimeZone() We use the spark view engine in asp.net mvc and want it to work on medium trust…
Emil C
  • 1,315
  • 4
  • 15
  • 27
0
votes
1 answer

How can I see the parameters in intellisense in a spark file?

I've got spark intellisense working but when I open the parameters () of the method I can not see what is supposed to go in there and several of the methods have overloads so I can't see what options I have. For example !{Html.Hidden()} once I open…
kurasa
  • 5,205
  • 9
  • 38
  • 53
0
votes
2 answers

Spark view engine - passing model to partial view

It would like to iterate through list and render partial view for each element: How should I pass elem to partial view? doesn't have additional…
LukLed
  • 31,452
  • 17
  • 82
  • 107
0
votes
1 answer

How to create a custom html tag using the spark viewengine?

I've heard or read somewhere (can't recall where) that the spark view engine supports the notion of defining custom html tags. I would like to use this for rounded corners. Which in our HTML consist out of 6 different div's wrapped around the actual…
olle
  • 4,597
  • 24
  • 28
1 2 3
14
15