Using confirmation before delete from ListView using C#. I have a ListView with CheckBox in it and I want to Delete the Items/Records from ListView which are selected with CheckBox in to it.
i.e Multiple select items and then Delete these Multiple Records from ListView I use SqlDataSource to bind data :) Any Idea?
<asp:ListView runat="server" ID="listBaiBao" OnSorting="listBaiBao_Sorting">
<LayoutTemplate>
<table id="tblBaiBao" class="table table-bordered table-hover tablesorter">
<tr runat="server">
<th runat="server"><asp:CheckBox OnCheckedChanged="chkAll_CheckChanged" runat="server" ID="chkAll"/></th>
<th runat="server"><asp:LinkButton CommandName="Sort" CommandArgument="TenBaiBao" ID="lnkTen" runat="server">Tên bài báo <i class="fa fa-sort"></i></asp:LinkButton></th>
<th runat="server"><asp:LinkButton runat="server" CommandName="Sort" CommandArgument="SoBao" ID="lnkSoBao">Số báo <i class="fa fa-sort"></i></asp:LinkButton></th>
<th runat="server"><asp:LinkButton runat="server" CommandName="Sort" CommandArgument="NamPhatHanh" ID="lnkNamPH">Năm phát hành <i class="fa fa-sort"></asp:LinkButton></i></th>
<th runat="server"><asp:LinkButton runat="server" CommandName="Sort" CommandArgument="TacGia" ID="lnkTacGia">Tác giả <i class="fa fa-sort"></i></asp:LinkButton></th>
<th runat="server"><asp:LinkButton runat="server" CommandName="Sort" CommandArgument="DuongDanFile" ID="lnkDuongDan">Đính kèm <i class="fa fa-sort"></i></asp:LinkButton></th>
<th runat="server">Edit</th>
</tr>
<tr id="ItemPlaceholder" runat="server">
</tr>
</table>
<asp:DataPager ID="ItemDataPager" runat="server" PageSize="10">
<Fields>
<asp:NumericPagerField CurrentPageLabelCssClass="pagenum-active" NumericButtonCssClass="pagenum" NextPreviousButtonCssClass="pagenum" ButtonCount="2" />
</Fields>
</asp:DataPager>
</LayoutTemplate>
<ItemTemplate>
<tr>
<td>
<asp:CheckBox runat="server" ID="chk"/>
</td>
<td>
<asp:Label runat="server" Text='<%# Eval("TenBaiBao") %>'></asp:Label></td>
<td>
<asp:Label runat="server" Text='<%# Eval("SoBao") %>'></asp:Label></td>
<td>
<asp:Label runat="server" Text='<%# Eval("NamPhatHanh") %>'></asp:Label></td>
<td>
<asp:Label runat="server" Text='<%# Eval("TacGia") %>'></asp:Label></td>
<td>
<asp:Label runat="server" Text='<%# Eval("DuongDanFile") %>'></asp:Label></td>
<td>
<a class="btn btn-info" href='index.aspx?page=suabaibao&id=<%# Eval("MaBaiBao") %>'><i class="fa fa-edit"></i></a>
</td>
</tr>
</ItemTemplate>
</asp:ListView>