<a> tag refreshes my asp.net page

时间:2015-04-25 16:53:21

标签: c# asp.net

I have an tag within my listview to direct the user to the profile page

<a class="btn btn-sm btn-default" href="profile.aspx?ID=<%# Eval("ownerID") %>"></a>

The profile page works as I can load it myself. However when I hover over the tag it shows the the correct link that it'll be directed to, but when I click on it, it just refreshes the current page, I've used the tag the same way in different pages and it works but for some reason it does not work here.

What could be the reason why?

1 个答案:

答案 0 :(得分:0)

我认为您需要尝试这个锚标记,HREF应该是单引号。

<a class="btn btn-sm btn-default" href='profile.aspx?ID=<%# Eval("ownerID")%>'>For Test</a>