SparkViewEngine:是否有相当于 PHP Include 的可用功能?

发布于 2024-08-16 17:57:08 字数 173 浏览 3 评论 0 原文

我正在将 SparkViewEngine 与 ASP.NET MVC 1.0 一起使用,并且想知道是否有办法在当前视图中包含另一个视图。

例如,我有一个名为 ResourceManager.spark 的视图。 在此文件中,我想包含另一个名为 Resources.spark 的子视图。

谢谢! 安倍

I am using the SparkViewEngine with ASP.NET MVC 1.0 and was wondering if there is a way to include another View within your current view.

For example, I have this view called ResourceManager.spark.
Inside this file, I want to include another sub-view called Resources.spark.

Thanks!
Abe

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清晰传感 2024-08-23 17:57:08

是的,您可以使用部分文件。其语法是,

<use file="Resources" />

它将在 View/> 中查找名为 Resources.spark 的文件。目录,如果在共享目录中找不到该目录。

如果您将文件命名为 _Resources.spark,那么您还可以将其用作自定义元素(无下划线),如需

<resources />

了解更多信息,请参阅 http://sparkviewengine.com/documentation/organizingcontent#Parsingandrenderingpartialfiles

Yes you can using a partial file. The syntax is

<use file="Resources" />

it will then look for a file called Resources.spark in the View/<ControllerName> directory and if that isn't found in the shared directory.

If you name the file _Resources.spark then you could also use it as a custom element (sans the underscore) like so

<resources />

for more information see http://sparkviewengine.com/documentation/organizingcontent#Parsingandrenderingpartialfiles

离笑几人歌 2024-08-23 17:57:08

当然,您可以使用命名内容区域。

查看 Spark 网站 上的文档

DimeCasts.Net

Sure, you can use named content areas.

Take a look at the documentation on the Spark website

There is also a good video tutorial at DimeCasts.Net

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文