I would like to have asp:Button and when I click it, I dont want it to do postback but add a new div into . here is my code
<script type="text/javascript">
$(document).ready(function (e) {
$('#<%=btn_comment_add.ClientID %>').click(function (e) {
$('#comments').append('<div>asd</div>');
return false;
});
});
</script>
here is the asp.net button
<asp:Button ID="btn_comment_add" runat="server" Text="Gönder" CssClass="theme04" UseSubmitBehavior="false" />
I can see that code adds the div but it postbacks so it gets deleted. I see the new div for a second only:)
please help me to fix it so it wont postback. Thank you very much people
type="button"not prevent the button from being a submit button? I think by default it renders astype="submit".