I have a repeater and inside item template I have a button and an anchor.
<asp:Repeater runat="server" ID="rptCategoryList" OnItemDataBound="rptCategoryList_ItemDataBound">
<ItemTemplate>
....
<div style="margin-left: 81.6%;">
<span runat="server" id="spnRegister" clientidmode="static" class="register pull-right">
<button class="btn btn-info btn-lg" style="float: ; margin-right: 40px; margin-top: -150px; background-color: #3697EA">
<a href="register.aspx" style="color: white;" target="_self">Register</a>
</button>
</span>
</div>
....
</ItemTemplate>
when this button is clicked it reloads the same page rather going to register.aspx. I used "view page source" and href is set correctly.
I removed the anchore and added a class to button and used jQuery:
<button class="btn btn-info btn-lg registerSilver" style="float: ; margin-right: 40px; margin-top: -150px; background-color: #3697EA">
Register
</button>
$(function () {
$('.registerSilver').click(function () {debugger
window.location = 'register.aspx';
});
});
still not working, keeps reloading the same page.
I even tried to add runat="server" to the hyperlink and set its href in repeater's itemdatabound, no luck.
What am I missing here?
type="button"attribute e.g.<button type="button" ...><a href="register.aspx" ...>Link Text</a></button>. - Tetsuya Yamamoto