I am making a website that displays information about various other websites. I want there to be a drop-down list containing the names of each of these other websites. When the user selects one of these site's names, the page should be refreshed with this site's ID as a query parameter in the URL. For example, if the user wants to view "Website1" with ID "12000," the URL should be "http://dnndev.me/Home/SiteInfo?ID=12000." To do this, I have made a form with an Add Button. The code for the Add Button is
<AddButton Text="Select" Redirect='[[Join("/Home/SiteInfo?ID={0}",[[site_id]] )]]' RedirectMethod="get" />
This works fine, as long as "SiteInfo" is the page that should be refreshed. I would like to know how I could redirect to the current page without hard-coding a URL like this. This would allow me to use the same form on multiple pages, without having to make a copy of it for each page. I know that, in JavaScript, "window.location.href" gets the current URL.
I tried doing
<AddButton Text="Select" Redirect='[[Join(window.location.href + "?dealer_location_id={0}",[[dealer_location_id]] )]]' RedirectMethod="get" />
, but this didn't work.
Is there any other way I could use the Add Button to redirect to the current page?