开发者

asp.net mvc c# - property EntryList of ViewData class

开发者 https://www.devze.com 2023-01-13 22:05 出处:网络
I dont know where is my problem to access EntryList in ViewData. <%= Html.RenderPartial(\"LogO开发者_如何转开发nControl\", new NISE.Web.TestForum.Views.Shared.PaginationViewData()

I dont know where is my problem to access EntryList in ViewData.

  <%= Html.RenderPartial("LogO开发者_如何转开发nControl", new NISE.Web.TestForum.Views.Shared.PaginationViewData()
  {
      PageIndex = ViewData.*EntryList*.PageIndex,
      TotalPages = ViewData.*EntryList*.TotalPages,
      PageActionLink = Url.Action("List","Entry", new { category = ViewData.Category, page = "{page}"}),
      TotalCount = ViewData.*EntryList*.TotalCount,
      PageSize = ViewData.*EntryList*.PageSize
  }, null)%>

I did everything like here

but it doesnt works... :(


One of the comments posted on the blog entry you linked to says:

I’m trying with MVC Preview 3 but at the view form the system do not find ViewData.EntryList. Where is it?

The answer was:

You need a strongly typed ViewData class – EntryList is just a sample property in this ViewDataClass. Here is a nice blogpost about strongly typed ViewData classes: http://blog.codeville.net/2008/02/21/aspnet-mvc-making-strongly-typed-viewpages-more-easily/

0

精彩评论

暂无评论...
验证码 换一张
取 消