I am using asp.net 4.5 with c#.From repeater on delete command I want to show confirmation dialog box.If user Press "Yes" than delete that record.My delete logic is in "rep_ItemCommand" event.Here Is my Code
<as:Pager ID="pgeImportedFiles" AutoPostBack="True" EnableViewState="true" runat="server" RepeaterControlID="rptImportFiledata" Visible="false" PageSize="10" DisplayPagerOption="Top">
<RepeaterTemplate>
<asp:Repeater ID="rptdata" EnableViewState="true" runat="server" OnItemCommand="rptdata_ItemCommand" >
<ItemTemplate>
<div >
<asp:LinkButton ID="lbnDelete"
OnClientClick="javascript:return showConfirmation('Are you sure You want to Delete this File?',this.id);"
runat="server" CommandName="Delete" CssClass="EditBtn" CommandArgument='<%# Eval("ID") %>'>Delete</asp:LinkButton>
</div>
</ItemTemplate>
</asp:Repeater>
</RepeaterTemplate>
</as:Pager>
protected void rptdata_ItemCommand(object source, RepeaterCommandEventArgs e)
{
//logic for deleteing
}
this javascript in js file and "divDialogMessage1" and "divAlertBox1" defined in this file
$(divDialogMessage1).html(confirmationMessage,uniqueID){
var result = false;
$(divAlertBox1).dialog({
title: "Confirmation",
buttons: {
"Yes": function () {
__doPostBack(uniqueID);
$(this).dialog("close");
},
"No": function () {
$(this).dialog("close");
}
}
});
$(divAlertBox1).dialog('open');
return result;}
By this dialog is display on click on delete link and page also post back if select "yes" option.But rptdata_ItemCommand not firing.
Any solution for this?
return result;