Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Developers,

I'm using Confirm Popup open in a button onclientclick event ..

In this
if(the user click ok in confirm popup)
i need the post back to be happened and i need the button click event to perform //Working Fine
else
I don't want the postback .. I mean the button click event should not be performed..//Here also postback happening..


Actually i want to avoid the unwanted postback here.. Is there any possibilities...

I'm using C# as Code behind..


Kindly do the needful... Thank you in advance..

Regards,
Ganesh kumar K
Posted

1 solution

try this function:-

C#
function confirmationMsg()
{
    var answer = confirm("Do you want Reset this page?")
    if (answer){
        document.getElementById('btnName').click();
        return  true;
    }
    else{
        return false;
    }
}


and call on your buttons's
OnClientClick="return confirmationMsg();"
 
Share this answer
 
Comments
GANESH KUMAR K 22-Aug-13 0:10am    
Thanks a lot :-)

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