我想知道为什么ResolveUrl()函数删除href属性值,以及作为http://localhost:PORT字符串传递的任何内容最终导致http://localhost:PORT。例如:
<a href="<% ResolveUrl(@"~/Home.aspx?param=1");%>">SomeText</a>决意
<a href>SomeText</a>编辑解决方案帮助了我,但并没有解决实际问题:
我没有将URL放在ResolveURL函数中。我添加了runat="server"。就像这样:
<a href="~/Home.aspx?param=1" runat="server">SomeText</a>发布于 2017-11-08 16:32:51
使用这样的单引号:
<a href='<%= ResolveUrl(@"~/Home.aspx?param=1") %>'>SomeText</a>如果这对你有帮助,请标记为正确的答案:)
https://stackoverflow.com/questions/47178260
复制相似问题