Using Html.RenderPartial() in ascx files

后端 未结 3 1041
走了就别回头了
走了就别回头了 2021-01-01 11:49

I\'m trying to use Html.RenderPartial in acsx file and I\'m getting an error:

Compiler Error Message: CS1973: \'System.Web.Mvc.HtmlHelper\' has no a

3条回答
  •  没有蜡笔的小新
    2021-01-01 12:22

    The only way i found to pass eg. an IEnumerable was to create a local variable and pass in this one. For Example @{ IEnumerable friends = Model.Friends; Html.RenderPartial("_FriendsList", friends); }

    Html.RenderPartial("_FriendsList", (IEnumerable)(Model.Friends)); did not work!

提交回复
热议问题