Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination links not working because PagingListOfT.PageParameterName is set to 'page' which is a reserved route name. #21

Closed
mvsantos013 opened this issue Mar 8, 2019 · 5 comments

Comments

@mvsantos013
Copy link

There is more context on this question I submitted on StackOverflow. Right now the code is using a reserved route name called 'page', it doesn't work when the app has Identity features.

Here's a solution: change PagingListOfT.PageParameterName default name.

Additional: Insert in PagingOptions a 'public string PageLinkUrlGetName { get; set; } = "bookpage";' option.

@sonnemaf
Copy link
Owner

sonnemaf commented Jul 4, 2019

This would be a breaking change, old code won't work any more. We must search for a solution for that.

@sonnemaf
Copy link
Owner

Added a PageParameterName to the PagingOptions. You can set this to for example pageIndex. Make sure you also rename the parameters of your Actions.

services.AddPaging(options => {
    options.ViewName = "Bootstrap4"
    options.PageParameterName = "pageindex";
});

@coommark
Copy link

I am leaving this comment for anyone else who might encounter an issue similar to mine. In the documentation, it mentions a fix for applications with Areas. In my specific instance, my application is Multitenant, and also uses Areas. Thus the routes are something like this: https://localhost:44364/Tenant/Area/Users.

None of the fixes mentioned here worked for me. The workaround for me was, instead of using:

<nav aria-label="Suppliers navigation example">
    <vc:pager paging-list="@Model" />
</nav>

I used the snippet below (taken from the original post), and that worked!:

<nav aria-label="Suppliers navigation example">
    @await this.Component.InvokeAsync("Pager", new { pagingList = this.Model })
</nav>

Thank you for this package.

@ribeiro-dev
Copy link

I am leaving this comment for anyone else who might encounter an issue similar to mine. In the documentation, it mentions a fix for applications with Areas. In my specific instance, my application is Multitenant, and also uses Areas. Thus the routes are something like this: https://localhost:44364/Tenant/Area/Users.

None of the fixes mentioned here worked for me. The workaround for me was, instead of using:

<nav aria-label="Suppliers navigation example">
    <vc:pager paging-list="@Model" />
</nav>

I used the snippet below (taken from the original post), and that worked!:

<nav aria-label="Suppliers navigation example">
    @await this.Component.InvokeAsync("Pager", new { pagingList = this.Model })
</nav>

Thank you for this package.

Same here.
You saved me, thanks!

@fiopras
Copy link

fiopras commented Nov 2, 2023

THANK U SO MUCH UR HELPING ME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants