 <p>well, i found an answer from internet,</p> <pre><code> &lt;script type="text/javascript"&gt; $(document).ready(function () { $("#&lt;%=InsertBtn.ClientID %&gt;").click(function (e) { var respond = confirm("Press ok if you confirm"); if (respond != true) { e.preventDefault(); } }); }); &lt;/script&gt; &lt;asp:Button ID="InsertBtn" runat="server" Text="Insert" OnClick="InsertBtn_Click" /&gt; </code></pre> <p>by using the preventDefault() to cancel the onclick default action</p>