I have a table in an update panel. This table gets filled form the code behind and there is also a button added. This button triggers a Javascript. Because this button triggers a Javascript I don't need the button to do a postback. Is there a way to disable this postback?
This is the code I use to set the imagebutton in a table cell for each row.
ImageButton ibtnTableOneNewComment = new ImageButton();
ibtnTableOneNewComment.ImageUrl = "~/img/Pencil.png";
ibtnTableOneNewComment.OnClientClick = "setDiscription('test', 'testy')";
tabCell.Controls.Add(ibtnTableOneNewComment);
The table headers get set in the asp, the rest from the code behind.
<asp:UpdatePanel runat="server" ID="up_tableMain" UpdateMode="Conditional">
<ContentTemplate>
<asp:Table runat="server" ID="tbl_main">
...Headers...
</asp:Table>
</ContentTemplate>
</asp:UpdatePanel>
Put return false; in your OnClientClick
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With