I'm still not sure what you're having problems with....if it's your JavaScript that's causing problems....
Have the submit button return a call to the JavaScript function when it's clicked. That JavaScript function will have to check to make sure that the user wants to delete. If the user clicks No have the function return false...since the button click code also returns false the button click event will be cancelled.
This is a little hard to describe in words so here's an example of what I'm talking about
:
- <asp:Button ID="btn_delete" runat="server" OnClientClick="return confirmDelete()" />
Notice the
return...if the confirmDelete function returns false then the OnClientClick will return false...which cancels the click event (and the page does not submit to the server). If the confirmDelete function returns true then the click event will proceed as normal.
Now, if it's not JavaScript that's causing problems, and it's your C# code that's not working then you're going to have to post the code that you have for deleting so that we can see what you're doing and help you to find the problem. (Please remember to use
code tags when posting code)
-Frinny