I am trying to work with web forms. I have basic knowledge only (I mainly work with MVC).
<asp:Button runat="server" ID="LinkButton1" OnClientClick="return confirmItemDelete()" CommandArgument='<%# Eval("id") %>' Text="Delete" OnClick="lbDeleteMessage_Click"></asp:Button>
function confirmItemDelete() {
bootbox.confirm('Are you sure you want to delete this message?',
function (confirmed) {
return confirmed;
});
};
Button click always causes server side Delete. This is because bootbox.confirm
works with callbacks (return false or true only in callback). This causes always run server side postback.
What is the best solution here?
You can use other html control for call
bootbox
and usejavascript
call<asp:Button />
for click in callback.HTML
Javascript