Following this problem ASP.NET: OnServerClick event handler not called if using onclick
I implemented a workaround:
<button id="idBtnPrint" runat="server" type="submit" onserverclick="BtnPrint_Click" onclick="confirmImpression();">print</button>
javascript function:
function confirmImpression() {
if (!confirm("sure ?"))
arg.whatever;
}
where confirmation is positive the postback is started when cancel the postback is not run (as I want) simply because an error generated js "arg is undefined" (normal because arg is not instanciate) script is locked and therefore no postback (as I want too).
but how to do this properly. I would not see the error appear in the status bar in the browser.
any suggestion is welcome!
thank you