For unavoidable design reasons, in my head tag on my top level MasterPage
I have:
<base href="http://127.0.0.1/" />
The URL of the page I'm having difficulties with is:
http://127.0.0.1/store/checkout
On this content page
I have the control:
<asp:Button runat="server" Text="Payment ▶" />
However when clicked, it posts the form to:
http://127.0.0.1/checkout
Which throws a 404, as it is not store/checkout
as it should be.
How can I resolve this issue so that the form is posted to the correct URL, AND it must degrade gracefully so that if JS is disabled it will post correctly, which is why unfortunately I cannot accept any Javascript solutions!
Doh! I've been struggling with this for days and have just stumbled across the answer.
On the master page I created a new method:
Then from the content page I call:
This fixes it!