Click here to Skip to main content
15,918,742 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
After OnClientClick event OnClick event not fire.
My code as follows.
function permissions() {
            var add = 1;
            if (add == 0) {
                alert("You have no permissions to Add Record");
                return false;
                return true;

<asp:Button ID="btn_new" CssClass="btn btn-sm btn-success" runat="server" Text="Add New" onclick="btn_new_Click" OnClientClick="javascript:return permissions();" />

what issue in my code? if not So why it not work well, please Provide Working Solutions..!!

if it returns false the server code doesn't execute.... viceversa........
Share this answer
finally found solution my self.
<pre lang="HTML"><asp:button id="btn_new" cssclass="btn btn-sm btn-success" runat="server" text="Add New" onclientclick="if(!permissions()){return false;}" xmlns:asp="#unknown"></asp:button>
Share this answer
<asp:button id="btn_new" cssclass="btn btn-sm btn-success" runat="server" text="Add New" onclick="btn_new_Click" onclientclick="permissions();" xmlns:asp="#unknown" />
Share this answer
rahul003 11-Feb-14 3:48am    
It not work my side.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900