spark-view-engine

asp.net mvc 2 preview 2 and Spark

独自空忆成欢 提交于 2019-12-12 13:29:13
问题 Some body tried Spark View Engine with asp.net mvc 2 preview 2? I have a problem with AREAS . It looks likes spark engine looks **.spark* files inside of Views folders only instead of Areas folder in additionally. My question is: Somebody has information how to add it? 回答1: Spark will not automatically check the area views location in the current version. If you're willing to change the source (which i assume you are if you're doing mvc 2 stuff), here's the fix: You have to modify the file

ASP.NET MVC 2 and sparkviewengine rendering single quotes to double quotes in html5 data- attribute

坚强是说给别人听的谎言 提交于 2019-12-12 10:22:54
问题 I'm having a problem with adding a json value as a data-attribute in a html5 page. We use the spark view engine (v1.5) in our asp.net mvc 2.0 website. The following viewcode: <a href='${Url.Action("edit", new { id = vehicle.VehicleId })}' title='Bewerken' class='dialog dialog-edit' data-dialogoptions='{"beforeOpen":"initAlarmZoneForm"}'><span class="silk-icon silk-icon-page-edit"></span></a> is being rendered as: <a href="/Alarm/AlarmZone/edit/4" title="Bewerken" class="dialog dialog-edit"

Render ASP.NET MVC Spark view to string, fails grandchildren views

ε祈祈猫儿з 提交于 2019-12-12 05:33:40
问题 I am using ASP.NET MVC 2 with the Spark view engine. I have a view that renders correctly when ASP.NET itself renders it, but when I perform an ajax call to re-render a partial view to a string so that I can replace the html with jQuery, it renders the partial view, its children, but not its grandchildren views. The view hierarchy is Index-> Parent Partial View -> Child Partial View -> Grandchild Partial View. The code below is being used to render the Parent Partial View to a string:

Stop Sparkview escaping html

…衆ロ難τιáo~ 提交于 2019-12-12 01:52:14
问题 I am trying to output some HTML video tags park of which include <source src="${Model.WebMFilename}" type='video/webm; codecs="vp8, vorbis"' /> However in the browser this renders as <source vorbis""="" vp8,="" type="video/webm; codecs=" src="VP8_645001.webm"></source> Any idea how I stop Sparkview reformatting the output? 回答1: Are you sure about your output? I ran this exact scenario through a unit test in the source code and I got the following: Input: <source src="${Model.WebMFilename}"

adding URL to html.grid column

牧云@^-^@ 提交于 2019-12-11 09:59:36
问题 !{Html.Grid(Model.Results) .Columns(column => { column.For(x => x.Title).Named("Article Name"); column.For(x => x.Sites); column.For(x => x.PreviousPath).Named("Previous Path"); column.For(x => x.CurrentPath).Named("Current Path"); column.For(x => x.PreviousUrl).Named("Previous Url"); column.For(x => x.CurrentUrl).Named("Current Url"); column.For(x => x.LogDate).Named("Date"); } ) .Empty("There are no R301s.") } In the above grid I have a CurrentUrl. This URL is pointing to a website. I need

Literals that precede { in spark view engine

最后都变了- 提交于 2019-12-11 07:30:38
问题 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 { 回答1: Also ?{ for conditional output. 回答2: Found one: The syntax $!{expression} can also be used if you want to ensure any null values and NullReferenceException that result from the

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

情到浓时终转凉″ 提交于 2019-12-09 15:44:48
问题 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 .NET 4). The issue I'm having currently is only occurring when using the spark view engine. Here is the relevant bit of code in my View.spark (strongly typed): ${Html.EditorFor(e => e)} The same bit of code works just fine if I use an .aspx view: <%

ASP.NET MVC View Engine Resolution Sequence

自闭症网瘾萝莉.ら 提交于 2019-12-09 10:05:05
问题 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 the same Product view folder. The Application_Start looks like protected void Application_Start() { RegisterRoutes(RouteTable.Routes); ViewEngines.Engines.Clear(); ViewEngines.Engines.Add(new Spark.Web.Mvc.SparkViewFactory()); ViewEngines.Engines

Spark View Engine Bindings with Class Html Attribute

帅比萌擦擦* 提交于 2019-12-07 23:13:45
问题 I've been using the Bindings feature with the spark view engine to replace quite a few of my Html helper method calls. One problem I have is that I want to define a css class to pass in to the anonymous dictionary parameter of the helper methods, which I would normally do like this: ${Html.EditorFor(x=>x.Username, new{@class = "css-class"})} Replacing this with a spark Binding looks like this: Binding: <element name="Editor">Html.EditorFor(x => x.@For, new {"@*"}) </element> View Element:

Cannot use Html.ActionLink in asp.net mvc spark files

大城市里の小女人 提交于 2019-12-06 02:23:48
问题 I'm using the spark view engine with my asp.net mvc application. In my aspx pages, I can succesfully use Html.Actionlink, but when I attempt it in spark files, it doesnt show up in intellisense, and when i try to run it anyway, i get: Dynamic view compilation failed. c:\Users\midas\Documents\Visual Studio 2008\Projects\ChurchMVC\ChurchMVC\Views\Home\Index.spark(73,25): error CS1061: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'ActionLink' and no extension method 'ActionLink'