ASP.NET MVC: Passing the List Management to Something

I want to have a strongly typed user control that accepts a class PaginatedList<T>

What my signature for this user control will look like and how to do it?

At the moment, I have this as my signature for the user control:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Project.Models.PaginatedList<Project.Models.Product>>" %>

Obviously this does not work when I pass a PaginatedList that contains something other than the product. Like here when I want to send a PaginatedList from the news:

<% Html.RenderPartial("Pagination", Model.NewsItems); %>

Any help would be greatly appreciated.

+3
source share
1 answer

- ViewUserControl<IEnumerable>. , PaginatedList, PaginatedList ViewUserControl<IPaginatedList>.

+3

Source: https://habr.com/ru/post/1717103/


All Articles