return value to caller from jConfirm dialog

saautnae

New Member
I'm using \[code\]asp.net\[/code\] for developing a site.It contains an Admin panel, which can delete employees when a cancel image is clicked.At first i've handled this using \[code\]confirm\[/code\], avaliable in javascript, but this shows the title as \[code\]Message from website\[/code\].So, i've planned to use \[code\]jConfirm\[/code\] pluginHere is the code that i've used\[code\]function confirm_delete() { jConfirm("Are you sure you want to delete employee?", "Delete Employee", function (callback) { if (callback) { return true; } else { return false; } }); }\[/code\]Here is code in gridview:\[code\]<ItemTemplate><asp:ImageButton ID="imgDelete" OnClick="imgDelete_Click" ImageUrl="~/images/delete.gif" runat="server" OnClientClick="return confirm_delete()"/></ItemTemplate>\[/code\]My problem is that when the \[code\]imgDelete\[/code\] image is clicked, it goes to \[code\]confirm_delete()\[/code\] function and it executes entire function atonce, without waiting for confirmation of request from user.While this is not the case with normal javascript \[code\]confirm\[/code\], it waits until request comes from user.So, when i click on \[code\]imgDelete\[/code\] employee record is being deleted, without waiting for confirmation. function always returns false even when ok is clicked. How to get rid of this ?Any help would be greatly appreciated.
 
Back
Top