gpt4 book ai didi

asp.net - Razor View - 在 Doctype 标记外发出 html

转载 作者:可可西里 更新时间:2023-11-01 13:16:52 25 4
gpt4 key购买 nike

我正在尝试使用 Razor View 引擎编写基于模块/区域的 mvc3 CMS。我有两个布局 View ,_site.cshtml 和 _modules.cshtml。 _site.cshtml 有一个@RenderBody() 部分。我的应用程序总是调用名为“index.cshtml”的 View ,其布局设置为 _site.cshtml 页面。问题:问题是我的模块/区域在 doctype 元素之前呈现 - 而不是在布局页面的 RenderBody 部分内。

最佳答案

看起来您正在尝试做的是 Html.RenderAction(或 Html.Action)的等价物,那么您为什么要自己编写所有代码而不是使用内置功能?

关于asp.net - Razor View - 在 Doctype 标记外发出 html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6711190/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com