加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net-mvc – 奇怪的MVC问题

发布时间:2020-12-15 23:05:30 所属栏目:asp.Net 来源:网络整理
导读:我有以下代码的麻烦: @Html.RenderPartial("_SortDisplayPage",new ViewDataDictionary { { "bottomClass","pagingBottom" } }) 它给出错误: Cannot implicitly convert type void to object 我觉得这很小,但找不到它 解决方法 你想要@ Html.Partial不是Re
我有以下代码的麻烦:
@Html.RenderPartial("_SortDisplayPage",new ViewDataDictionary { { "bottomClass","pagingBottom" } })

它给出错误:

Cannot implicitly convert type void to object

我觉得这很小,但找不到它

解决方法

你想要@ Html.Partial不是RenderPartial. RenderPartial直接写入响应,不返回值.部分返回一个MvcHtmlString,@运算符将写入响应.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读