A page link is a hyperlink that navigates to a specific page of a paginated product collection. In ASP.NET Core, a tag helper can generate the links from paging data instead of forcing customers to discover query-string parameters. section 7.4.1
A practical implementation connects four pieces:
- A PagingInfo view model carries total items, items per page, and the current page; TotalPages is calculated from those values. section 7.4.1
- The controller selects products with Skip and Take, then passes products and PagingInfo through ProductsListViewModel. section 7.4.1
- A PageLinkTagHelper targets a div with page-model and populates it with page-specific anchor elements. section 7.4.1
- The view renders the helper with page-model="@Model.PagingInfo" and page-action="Index". section 7.4.1
Navigating to page two
A request such as http://localhost:5000/?productPage=2 selects the second product page; rendered links make that navigation discoverable. section 7.4.1
http://localhost:5000/?productPage=2
Inspect the concrete URL used to request the second page of products. section 7.4.1
