spark-view-engine

Spark engine conditional test

We use spark to generate HTML-mails. When merging our data into the template I noticed a difference between <if condition="Equals(#context.UserAccount.Country,'BE')"> <p>You live in Belgium</p> </if> <else> <p>You don't live in Belgium</p> </else> and <if condition="#context.UserAccount.Country == 'BE'"> <p>You live in Belgium<...

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 specific CSS tags and currently I'm just sticking the link tag in the body as something like: <c...

Spark compiled views locating

Hello I have a problem with Spark. I have compiled assembly with views, located in bin subfolder of website, that i created like below engine.BatchCompilation(targetFolder, Global.AllKnownDescriptors()); On start of my app, a try to load compiled views: svf.Engine.LoadBatchCompilation(Assembly.LoadFrom(Path.Combine(basePath, "Shared...

How do you return a partial view with spark?

I am using the SparkViewEngine and I am calling an action that I want to return a Partial View to update just a section of the page. When I return the view on the action the masterpage and all of its content gets returned. How do you tell a partial in spark to just return the content of the partial view and not put the content inside t...

Spark view engine - why there is no VS integration in version 1.1?

I downloaded Spark 1.1 release from http://sparkviewengine.codeplex.com/releases/view/27601 and cannot find the msi package for Visual Studio integration promised in docs. Can anyone explain why? ...

Literals that precede { in spark view engine.

I was going through the spark view engine documentation and found a lot of literals showing up in code for which I couldn’t find any references. For e.g. ! , #, $ , !$ , ... What are these for? What do the combinations mean? When do they come into use? Am I missing any more literals that precede or comes after { ...

Spark engine without master page

I use application.spark file for master page In my app i have login page that does not need master page I tried remove master page from my login page using this tag , but it continue to use application.spark I can fix it by adding new master page in layout folder with name blank.spark file without any code and in my login page put this...

HTML comments in Spark view engine

How can I comment out parts of a Spark view so they aren't rendered to the client? In aspx pages I can do this: <%-- server-side comment --%> I had thought using three dashes would work: <!--- server-side comment ---> but it doesn't work and I now can't find the resource where I read that. ...

How do I use a spark variable in an html helper?

Can I use a spark variable inside an html helper? Say we have <var url="Url.Action(“get”)" /> !{Html.Image("~/Content/up.png")} Now if I need to use the url inside Html.Image as an attribute(part of the 2nd param) to get <img src="~/Content/up.png" type="~/engine/get" /> how do I go about doing it? ...

Spark show logged in user

How do I show the username of the person logged in within a Spark View? The default MVC view engine had a Page object that you could get the info from. How would I do that in spark? I know that I could put the info into the viewdata dictionary, which is probably the best, but I don't want to have to write ViewData["User"] = myUser; ...

Is SparkViewEngine dying?

Hey, I am building a email service based on templates. I thought of using the spark view engine but it seems that It doesn't get much updates anymore. Support on .NET4.0 is not even yet complete and it fails at runtime when used in a console app. The little Intellisense support that was there in VS2008 doesn't seem to work on VS2010 (fr...

Spark view engine and ASP.NET MVC 2 strongly Typed Html Helpers

Hi. I try to use HtmlHelper.TextBoxFor with spark view engine but view crashed with exception "Dynamic view compilation failed. 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'TextBoxFor' and no extension method 'TextBoxFor' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a u...

Is there any reasons to prefer SparkViewEngine over XSLT (or vice versa) for a standalone email generation?

I have a service that receives an object containing all the data needed to build a newsletter. I need to be able to generate the email using different templates. I don't want to involve the whole ASP.NET stack for that, so I want a separate templating engine. Reading a lot of opinions, I have found that XSLT was not getting very much lo...

How to use html.grid control in spark view for asp.net mvc?

class person() { public int Id{get;set;} public string Name{get;set;} } HomeController.cs ActionResult Index() { IList list=new[]{ new person { Id = 1, Name = "Name1" }, new person { Id = 2, Name = "Name2" }, new person { Id = 3, Name = "Name3" } }; ViewData["mygrid"]=l...

Using #DEBUG macros in spark

I have some scripts which need to be included only in the release version. Stuff like google analytics, quantserve etc. The typical way in asp.net mvc world is to wrap a #if DEBUG #endif How do I do it the sparkish way. Like <script if='x==5' type="text/javascript"> ...

Spark VS 2010 intellisense

I was thinking about switching one of my projects (and after that subsequently other projects too) to Spark View Engine but after todays research I ran into problem of a lack of Intellisense for Visual studio 2010. Not only that but it seems that the project is not maintained regularly. So I'm left with a feeling that I should not choos...

why spark files not included in publishe folder?

I tried file system publish and ftp I'm using VS2010 and .net 4.0 should i somehow include *.spark ext files to the MSBuild? ...

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 web application using ASP.NET MVC2 and the Spark view engine. There will be a couple of cont...

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 and trying to see if I can make something that fully featured and easy to use. The idea b...

Spark view engine - named content ignored with RenderAction

Application.spark: <html> <head> <use content="head"/> </head> <body> <use content="view"/> </body> </html> Index.spark: # Html.RenderAction("Hello"); // This renders _Hello.spark _Hello.spark: <content name="head"> <script src="/hello.js"></script> </content> <p>hello</p> And head content of _Hello.spark...