Using @Html.DisplayNameFor() with PagedList

后端 未结 5 648
囚心锁ツ
囚心锁ツ 2020-12-23 13:37

I\'ve been trying out the PagedList package to get paging for my index views. Everything was going well, and at the controller level everything is working fine, it only disp

5条回答
  •  [愿得一人]
    2020-12-23 14:07

    As an alternate solution you could try:

    @Html.DisplayNameFor(x => x.GetEnumerator().Current.ItemName)
    

    It will work even if the list is empty!

提交回复
热议问题