我试图获得一个部分视图,使用Razor在MVC5中渲染.当我使用
@{ Html.RenderPartial("ViewName",model); }
我得到解析器错误:
Unexpected “{” after “@” character. Once inside the body of a code block (@if {},@{},etc.) you do not need to use “@{” to switch to code.
当我删除{},即:
@Html.RenderPartial("ViewName",model);
我收到编译错误
Cannot implicitly convert type ‘void’ to ‘object’.
我究竟做错了什么?