Why does ASP.Net rewrite relative paths in runat=server anchor controls?
- by Atomiton
I have UserControls in a Controls folder in my solution:
/Controls/TheControl.ascx
If specify the following:
<a runat="server" href="./?pg=1">link text</a>
ASP.Net seems to want to rewrite the path to point to the absolute location. For example, If the control is on site.com/products/fish/cans.aspx the link href will be rewritten to read
<a href="../../Controls/?pg=1
Why does Asp.Net rewrite these control paths, and is there an elegant way to fix it?