关于 .net:Spark 电子邮件模板和主布局 | 珊瑚贝

Spark email templates and master layouts


我正在使用 MVC 之外的 spark 视图引擎来创建 HTML 电子邮件。我已将常用布局元素拉入主(模板)视图 (Application.spark),并使用 <use master=”Application.spark”> 从我的 *.spark 文件中引用主视图。但是,主视图中的 HTML 没有显示在我的电子邮件中。知道怎么做吗?这甚至可能吗?


Spark 不需要专门的 MSMVC 来让主布局和视图协同工作。

但除非您专门提供您自己的 IDescriptorFilter 版本,否则将使用 DefaultDescriptorFilter,并且它希望 Application.spark 文件位于主目录下名为 Shared 或 Layouts 的文件夹中Views 文件夹。如果它在这两个之一中,您甚至不需要从任何 *.spark 文件中引用它,由于它的名称和位置,它将按惯例使用。

从你提供的信息中我能说的就这些了,但我想这可能是别的东西,我必须查看一些代码或示例来帮助更多…

希望对您有所帮助,
罗伯


我通过将 Application.spark 作为模板添加到 descriptor:

来解决这个问题

1
descriptor.AddTemplate(“Application.spark”);

并在模板中使用 ${Content[“view”]} 而不是 <use content=”view”/>。

如果您在尝试后有任何问题,请告诉我。

CodePlex 网站上还有一个工作项:
http://sparkviewengine.codeplex.com/workitem/9035


来源:https://www.codenong.com/6062016/

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_8965.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?