gpt4 book ai didi

asp.net-mvc - asp.net mvc 局部 View 错误出

转载 作者:行者123 更新时间:2023-12-01 02:41:25 24 4
gpt4 key购买 nike

我的局部 View ,称为 _myTestView.cshtml

<div style="border:1px solid red;">

TEST

</div>

我这样称呼它
<div>
@Html.RenderPartial("_myTestView");
</div>

我收到以下运行时错误

Compiler Error Message: CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments



我究竟做错了什么?

最佳答案

您不在代码块内,因此不要使用 .RenderPartial
只需使用 .Partial并摆脱 ;

<div>
@Html.Partial("_myTestView")
</div>

关于asp.net-mvc - asp.net mvc 局部 View 错误出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8233729/

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