Click here to Skip to main content
15,917,971 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to delete the grid record with confirmation but in my case it not work well,provide solutions Note i am using bootstrap confirm box.
My code is:
client side:
JavaScript
function deletepermission() {

         var add = 1;
         if (add == 0)
         {
             bootbox.alert("You have no permissions to Delete Record"); return false;
         }
         else
         {
             bootbox.confirm("Are You Sure To Delete Record ?", function (result) {
                 if (result == true)
                 { return true; }

             });

         }
     }

ASP.NET
<telerik:GridTemplateColumn AllowFiltering="false" UniqueName="Action" HeaderText="Action" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
 <ItemTemplate>
 <asp:Button runat="server" ID="btnDelete" ToolTip="DeleteRecord" CommandName="DeleteButton" CommandArgument='<%# Eval("LandlordId") %>' Text="Delete" onclientclick="return deletepermission();" Height="22px"></asp:Button>
</telerik:GridTemplateColumn>
Posted
Comments
Did you debug the code?

you can give simple javascript alert box onclientclick="return alert(are you sure you want to delete this record?);"
In your case, if you want to use bootstrap confirm box ..please provide complete code(which liabrary you are using?)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900