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

PageRouteValueKey not working #69

Closed
scascalesageinfoes opened this issue Feb 6, 2018 · 4 comments
Closed

PageRouteValueKey not working #69

scascalesageinfoes opened this issue Feb 6, 2018 · 4 comments

Comments

@scascalesageinfoes
Copy link

Hello
I have this:
[Route("genericos-referencias}", Order = 3, Name = "appGenericosReferenciasController.Index.es")]
[Route("{lang}/generic-references}", Order = 4, Name = "appGenericosReferenciasController.Index.en")]
public async Task Index()
..

I want than MVC paging generate this link in every page:
http://localhost:29553/generic-references?page=2

I try set:
.PageRouteValueKey("appGenericosReferenciasController.Index.en")

But always get:
http://localhost:29553/genericos-referencias?page=2

Any mehtod to override base URL of links?
Thanks

@martijnboland
Copy link
Owner

I'm afraid we don't support named routes. However, I think we could add a routename option without too much effort to make this work. Is that something you could give a try yourself with a pull request?

@martijnboland
Copy link
Owner

martijnboland commented Feb 7, 2018

You could checkout the CustomRouteName branch, https://github.com/martijnboland/MvcPaging/tree/CustomRouteName

In this branch, the Pager has a new option .CustomRouteName(string customRouteName). See 8819a79 for all changes, including a demo controller action and view.

Please let us know if something like this would work for you.

@scascalesageinfoes
Copy link
Author

Perfect my friend! It works! Can you update the last versión of nuget with this change?

@martijnboland
Copy link
Owner

NuGet package is updated

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

2 participants