how can prevent page posting back
-
i have a webpage with asp button. in server side, i wrote some code for its button click event to delete the page data. but in client side i want user to confirm the deletion action. so i write this javascript code: {if(confirm("do want to delete data...."))} i don't know what to do to prevent page postback for false condition. what should i do...
Thanks Rastgar
-
i have a webpage with asp button. in server side, i wrote some code for its button click event to delete the page data. but in client side i want user to confirm the deletion action. so i write this javascript code: {if(confirm("do want to delete data...."))} i don't know what to do to prevent page postback for false condition. what should i do...
Thanks Rastgar
-
i have a webpage with asp button. in server side, i wrote some code for its button click event to delete the page data. but in client side i want user to confirm the deletion action. so i write this javascript code: {if(confirm("do want to delete data...."))} i don't know what to do to prevent page postback for false condition. what should i do...
Thanks Rastgar
-
Return a boolean in the click event of the button:
onclick="return confirm('Delete?');"
If the event returns false, the button click is stopped.--- b { font-weight: normal; }
Thanks alot. but your sample code doesn't work or atleast i couldn't understand you and apply your method. but i found another method in other forum. here it is... { if(confirm('do you want to delete?') return true; if(document.all && window.event) event.returnValue = false; return false; } it works so much better and do what exactly i wanted.
Thanks Rastgar
-
Thanks alot. but your sample code doesn't work or atleast i couldn't understand you and apply your method. but i found another method in other forum. here it is... { if(confirm('do you want to delete?') return true; if(document.all && window.event) event.returnValue = false; return false; } it works so much better and do what exactly i wanted.
Thanks Rastgar