我正在尝试基于 ViewBag 条件呈现 Razor html 部分视图,但我总是遇到编译错误。
@{
if (ViewBag.Auth)
{
@Html.RenderPartial("_ShowUserInfo")
}
}
我也试过...
@if (ViewBag.Auth)
{
@Html.RenderPartial("_ShowUserInfo")
}
Error message:
Compiler Error Message: CS1502: The best overloaded method match for
'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)'
has some invalid arguments