This is an old post, but for future reference in ASP.NET you can avoid the following errors:
<form action="#" runat="server">
This will be verified using the W3C and does not require special coding to detect the URL of the page where you are currently located.
user152949
source share