Will I get the advantage of the new Strongly Typed Html Helpers with asp.net MVC 2 if were to use the spark engine for rendering?
+5
A:
You can use any HtmlHelper that ship with the MVC framework in Spark view engine.
${Html.TextBoxFor(p => p.Name)}
Marwan Aouida
2010-01-14 17:25:24
Spark version 1 did not support strongly typed helpers. But if you want to use mvc2, you got to use newest build of Spark anyway.
Arnis L.
2010-01-15 10:04:18
+2
A:
Spark view page base class doesn't have public property Html with HtmlHelper type but u can add it yourself.
Add
<var Html="new HtmlHelper<YourModel>(base.ViewContext, this)"/>
on your spark view and after that u can use
${ Html.LabelFor(model => model.UserName)}
as well as ${Html.Label("some label")}
.
avishnyakov
2010-02-06 10:26:52
+1
A:
Whenever you are confused about it, you can't definitely know how to do, you still use aspx-like expression - <%statement%> :) Inline code in Spark supports #statement variation too.
Source: Spark expressions
tanza9
2010-02-27 04:39:39