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

Paging tag helper: Urls with same parameter more than once (e.g. for string[] properties) not supported #22

Closed
alexmohr1966 opened this issue Dec 2, 2021 · 2 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@alexmohr1966
Copy link

Hi Ziya,
I am using your excellent tag helper for a search result page, which contains dynamic filters implemented as anchor tags. Now I run into the following issue: when I submit values for a property of type string[] on the anchor element I add the same parameter more than once to the URL, which is interpreted by the ASP.NET model binder correctly. For example countryNames=Togo&countryNames=Lebanon fills the CountryNames string array correctly with [0]Togo and [1]Lebanon. Unfortunately this scenario is not supported by your tag helper and creates an "ArgumentException: An item with the same key has already been added. Key: countryNames". Looking at your code it occurs in the function CreatePagingUrlTemplate as you utilise a Dictionary here. Is there any chance that you can support the described scenario? Your consideration is much appreciated. Thanks.

@NareshBisht
Copy link

You can edit the anchor href attribute using javascript upon page load if you want a quick fix. I did the same in order to change URL from /?p=2&s=10 to /page/2.

@LazZiya
Copy link
Owner

LazZiya commented Dec 2, 2021

Hi @alexmohr1966,

Thank you for reporting this issue, I will work on an update and provide fix with the next version.

@NareshBisht thank you for the workaround :)

@LazZiya LazZiya self-assigned this Dec 2, 2021
@LazZiya LazZiya added enhancement New feature or request bug Something isn't working labels Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants