如何让 HTML.Partial 使用 T4MVC 常量?

发布于 2024-12-10 22:59:26 字数 286 浏览 6 评论 0原文

我已经开始使用 T4MVC,并试图弄清楚如何将 T4MVC 与 PartialViews 结合使用。 我目前

@Html.Partial("LocationGrid", Model.Locations)

想使用

@Html.Partial(MVC.Client.Views.LocationGrid, Model.Location)

,但 MVC.Client.Views.LocationGrid 返回完整路径而不是名称

I've started using T4MVC and I'm trying to figure out how use T4MVC with PartialViews.
I currently have

@Html.Partial("LocationGrid", Model.Locations)

I would like to use

@Html.Partial(MVC.Client.Views.LocationGrid, Model.Location)

but MVC.Client.Views.LocationGrid returns the full path not the name

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

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

发布评论

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

评论(1

信仰 2024-12-17 22:59:26

尽管它返回完整路径,但它工作得很好,因为 MVC 旨在处理其中任何一个。

Even though it returns the full path, it works fine as MVC is designed to handle either.

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