I would like to be able to delete a record from within an Asp.Net FormView ItemTemplate using an Asp button and an inline javascript confirm function.
The javascript works, I see the confirm dialog, when I click either button in the dialog, a postback does occur, but the record does not get deleted.
So far I have:
<asp:Button runat="server"
ID="btnDelete"
CssClass="NavigatorButton"
Text="Delete"
CausesValidation="true"
UseSubmitBehavior="false"
Visible="false"
CommandName="Delete"
OnClientClick="return confirm('This action will delete this provider note. Are you sure you wish to continue?');" />
The Delete works fine when I take the OnClientClick off the button, but I need the confirmation.
The javascript confirm works fine in the EditItem template.
Any ideas?