# \[Au2 Router\] Generate URL, query params, reload?

**URL:** <https://discourse.aurelia.io/t/au2-router-generate-url-query-params-reload/5463>\
**Category:** Help Requests\
**Created:** [June 16, 2024, 12:54pm UTC](https://discourse.aurelia.io/t/au2-router-generate-url-query-params-reload/5463 "2024-06-16T12:54:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![migajek](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/migajek/32/379_2.png) [@migajek](https://discourse.aurelia.io/u/migajek)\
**Post date:** [June 16, 2024, 12:54pm UTC](https://discourse.aurelia.io/t/au2-router-generate-url-query-params-reload/5463/1 "2024-06-16T12:54:16Z")

</div>

Trying to port Au1 app to Au2, I have a pretty basic component (paginator) that is based on the (optional) query parameters of the route.

When changing the page, it navigates to the current route but with a modified “pageNumber” query parameter. The view controller is responsible for passing the pagination parameters along with the request to the backend.

Now, I am facing a number of issues:

1. How do I pass query params (not named url segments) to `router.load`? In Aurelia 1, I believe all parameters passed that were not matched to the named segments of the route, were attached in form of a query params

2. How to generate the URL programmatically? I used to have a `href` attribute as well, so the middle button / open in new tab would work as expected

I can’t seem to find any surface api for either of those.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![ivan](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/ivan/32/2022_2.png) [@ivan](https://discourse.aurelia.io/u/ivan)\
**Post date:** [July 3, 2024, 1:43pm UTC](https://discourse.aurelia.io/t/au2-router-generate-url-query-params-reload/5463/2 "2024-07-03T13:43:27Z")

</div>

@migajek Did you find a solution?

---

<div class="post-metadata">

**Author:** ![migajek](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/migajek/32/379_2.png) [@migajek](https://discourse.aurelia.io/u/migajek)\
**Post date:** [July 5, 2024, 11:33am UTC](https://discourse.aurelia.io/t/au2-router-generate-url-query-params-reload/5463/3 "2024-07-05T11:33:25Z")

</div>

nope, I gave up on this. Created an internal service for generating links. This means I have to add the new routes twice - once to the router, once to the service - but it was the easiest solution for me.
