title: ASP.NET ResolveUrl returns only root
body: <p>I am wondering why <code>ResolveUrl()</code> function removes href attribute value and whatever I pass as a URL string ultimately leads to <a href="http://localhost:PORT" rel="nofollow noreferrer">http://localhost:PORT</a>. For example:</p>
  
  <pre><code>&lt;a href="&lt;% ResolveUrl(@"~/Home.aspx?param=1");%&gt;"&gt;SomeText&lt;/a&gt;
  </code></pre>
  
  <p>resolves to</p>
  
  <pre><code>&lt;a href&gt;SomeText&lt;/a&gt;
  </code></pre>
  
  <p><strong>[EDIT] A workaround that helped me</strong>, but didn't solve the actual problem:</p>
  
  <p>I didn't put the URL in <code>ResolveURL</code> function. I added the <code>runat="server"</code> instead. Like so:</p>
  
  <pre><code>&lt;a href="~/Home.aspx?param=1" runat="server"&gt;SomeText&lt;/a&gt;
  </code></pre>