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

Spark view engine with array of namevaluepair

I would like to use the Spark view engine (DirectUse) for email templating. So I have dived into the Spark examples (EmailOrTextTemplating). But what I want is to use an array of NameValuePair(String name, object value) objects in the viewdata as a…
ZxCvBnM
  • 277
  • 3
  • 14
0
votes
0 answers

create dynamic html elements and add to table asp.net

I used to some thing like this in jsp. <%@page language="java" import="java.util.*"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib prefix="tags"…
Aadam
  • 1,521
  • 9
  • 30
  • 60
0
votes
2 answers

Edit model object doesn't bind to view as expected

I'm using ASP.NET MVC (1.0), Spark View Engine (1.0) and SubSonic (3.0.0.3). I'm having some trouble getting an "Edit" view to work correctly. So, in my controller, I have the following controller action that displays the edit form…
Bob Yexley
  • 2,704
  • 4
  • 24
  • 35
0
votes
1 answer

For loop in Spark view engine / ASP.NET MVC

I'm using Spark with WPF. This works fine and I'm able to format a template and pull in scalar properties from a custom DTO (my model). I'm having difficulty getting for loops to work though. From looking at the Spark documentation, I should be able…
Echilon
  • 10,064
  • 33
  • 131
  • 217
0
votes
1 answer

Implementing Drop down list in c# using MVC-spark

Controller Code: List Months = new List(); Months.Add("Jan"); Months.Add("Feb"); ViewData["Months"] = new SelectList(Months); View Code: ${Html.DropDownList((SelectList)ViewData["Months"])} Error: Argument 2: cannot convert…
webtester
  • 21
  • 6
0
votes
1 answer

Can SparkView Engine create custom Tag?

Here Is there an ASP MVC equivilent to JSTL tags? it is said that there is equivalent between jstl for loop and sparkview engine loop. But beyond that can sparview allow to create custom tag without one digging into sparkview source code ie is it…
user310291
  • 36,946
  • 82
  • 271
  • 487
0
votes
1 answer

Can you create Spark view engine bindings with plain html in?

I really like the bindings feature of spark, it really improves markup but I have come across a small problem. Is it possible to create a spark binding that doesn't have any code in it just html? For example:
jcvandan
  • 14,124
  • 18
  • 66
  • 103
-2
votes
1 answer

Can I use a third party view engine for Razor Pages?

Although it is called Razor Pages for a reason I'm just wondering if it is possible to use a different view engine, say Spark Engine or any other View Engine you can think of. I also wonder the same thing for Blazor. Edit: This question was…
Efe Zaladin
  • 187
  • 2
  • 13
1 2 3
14
15