【发布时间】:2012-12-30 10:31:59
【问题描述】:
我将 Spark 与 WPF 一起使用。这很好用,我可以格式化模板并从自定义 DTO(我的模型)中提取标量属性。我很难让 for 循环工作。通过查看the Spark documentation,我应该能够做到这一点,但我得到了一个火花异常:
Dynamic view compilation failed.
c:\Users\Echilon\AppData\Local\Temp\tmp4490.tmp(73,73): error CS0103: The name 'Sections' does not exist in the current context
以下代码在模板中可以正常工作以从模型中提取 Name 属性:<h1>${Name}</h1> 但 for 循环会生成异常:
<for each="var sect in Sections">
${#sect.Name}
<!-- HTML for each element omitted -->
</for>
【问题讨论】:
标签: c# templates templating spark-view-engine