I have a ASP.Net WebForms site (powered by Kentico CMS if that has any bearing) where the URL in the form action is rendered as a relative URL on every page.
Ordinarily I would expect the form action to be an absolute path.
For example, if the page URL is /foo/bar/my-page
then I would expect the form action to be /foo/bar/my-page
but it's actually rendering as ./my-page
.
This is having an adverse effect on pages that use "friendly URLs" via rewriting in Kentico where those URLs have placeholders (i.e. /products/{productcode}/{productname}
).
Kentico translates the placeholder values into QueryString parameters under the hood but with the relative URL issue described above it's causing WebForms to append the query parameters to the relative URL
i.e. /products/123/my-product
should have the form action /products/123/my-product
but is instead being set to ./my-product?productcode=123&productname=my-product
which is then causing two instances of productcode and productname to exist in the query paremters... and the postbacks on that page to break.
What would cause this?