如何删除网格记录与confrimation [英] How delete the grid record with confrimation

查看:95
本文介绍了如何删除网格记录与confrimation的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想删除带有确认的网格记录,但在我的情况下它不能正常工作,提供解决方案注意我正在使用bootstrap确认框。

我的代码是:

客户端:

  function  deletepermission(){

var add = 1 ;
if (add == 0
{
bootbox。 alert( 您无权删除记录); 返回 false ;
}
else
{
bootbox.confirm( 您确定要删除记录吗? function (结果){
if (result == true
{ return true ;}

});

}
}



 <   telerik:GridTemplateColumn     AllowFiltering   =  false   < span class =code-attribute> UniqueName   = 操作    HeaderText   = 操作    ItemStyle-Horizo​​ntalAlign   =      HeaderStyle-Horizo​​ntalAlign   =  Le ft >  
< ItemTemplate >
< asp:按钮 runat = server ID = btnDelete 工具提示 = DeleteRecord CommandName = DeleteButton CommandArgument =' <% #Eval(< span class =code-string> LandlordId)%>' 文字 = 删除 onclientclick = return deletepermission(); 高度 = 22px > < / asp:按钮 >
< / telerik:GridTemplateColumn >

解决方案

你可以提供简单的javascript警告框onclientclick =return alert(你确定你想删除这条记录?);

在你的情况下,如果你想使用bootstrap确认框..请提供完整的代码(你正在使用哪个liabrary?)


请参考这里..



GridView删除,确认

如何显示确认消息删除网格视图行。

您确定在删除行之前在gridview中发出警告

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:

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; }

             });

         }
     }


<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>

解决方案

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?)


refer here..

GridView Delete, with Confirmation
How to show confirm message while deleting grid view row.
Are you sure" warning in gridview before deleting a row


这篇关于如何删除网格记录与confrimation的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆