Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

PagingList Paging Problem

$
0
0

Hello,

i use ReflectionIT.Mvc.Paging . If i klick of paging is comming home\Index\page=Numberpage...!

But my site name is other.. i need following home\othersite\page=Numberpage.. What is my Error..

Here is a part of code in PaginatedList.cs

namespace FIS.EKB.ProjektDB.Models
{
    public class PaginatedList<T> :List<T>
    {
        public int PageIndex { get; private set; }
        public int TotalPages { get; private set; }

        public PaginatedList(List<T> items, int count, int pageIndex, int pageSize)
        {
            PageIndex = pageIndex;
            TotalPages = (int)Math.Ceiling(count / (double)pageSize);

            this.AddRange(items);
        }

        public bool HasPreviousPage
        {
            get
            {
                return (PageIndex > 1);
            }
        }

        public bool HasNextPage
        {
            get
            {
                return (PageIndex < TotalPages);
            }
        }

        public static async Task<PaginatedList<T>> CreateAsync(IQueryable<T> source, int pageIndex, int pageSize)
        {
            var count = await source.CountAsync();
            var items = await source.Skip((pageIndex - 1) * pageSize).Take(pageSize).ToListAsync();
            return new PaginatedList<T>(items, count, pageIndex, pageSize);
        }
    }
}

in View Site is:

@model ReflectionIT.Mvc.Paging.PagingList<tabAuftragsdatenwert>
@using ReflectionIT.Mvc.Paging
@addTagHelper *, ReflectionIT.Mvc:Paging

@{ViewData["Title"] = "PdOverView"; }

<div>
    <nav aria-label="Oernekler">
        @await  this.Component.InvokeAsync("Pager", new {pagingList = this.Model })
    </nav>
    <table class="table table-striped">
        <thead>
            <tr>
                <th id="th_1">KommisionsNr</th><th id="th_2">S/U/G/E/ER/R/V-Nr</th><th id="th_3">Maschinentyp</th><th id="th_4">Linie</th><th id="th_5">Kunde</th>
                <th id="th_6">Land</th><th id="th_7">Stadt</th><th id="th_8">Datum</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td><a asp-action="PdOverView" asp-route-id="@item.ID">@Html.DisplayFor(modemItem => item.KommissionsNr)</a></td>
                    <td>@Html.DisplayFor(modemItem => item.SUGEER_Typ)@Html.DisplayFor(modemItem => item.SUGEER_Nr)</td>
                    <td>@Html.DisplayFor(modemItem => item.MaschinenModell)</td>
                    <td>@Html.DisplayFor(modemItem => item.Linie)</td>
                    <td>@Html.DisplayFor(modemItem => item.Kunde)</td>
                    <td>@Html.DisplayFor(modemItem => item.Land)</td>
                    <td>@Html.DisplayFor(modemItem => item.Stadt)</td>
                    <td>@Html.DisplayFor(modemItem => item.Lieferdatum)</td>
                </tr>
            }
    </table>

Thanks for Answers


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>