1.
Copy codeThe Code is as follows:
<Asp: ListView ID = "lvBalance" runat = "server">
<LayoutTemplate>
<Div id = "listDiv" style = "width: 100%; overflow-y: auto;">
<Table border = 0 cellpadding = 0 cellspacing = 0 style = "float: left; table-layout: fixed;" class = "datagrid-body easydatagrid">
<Asp: PlaceHolder id = itemPlaceholder runat = server/>
</Table>
<Div id = "div999" style = 'display: none; width: 200px; 'class = "div2"> </div>
</Div>
</LayoutTemplate>
<ItemTemplate>
<Tr> <td>
<Asp: LinkButton ID = "lb_delete" runat = "server" CommandArgument = '<% # Eval ("ItemCode ") %> 'onclientclick = "return confirm ('Are you sure you want to delete this message? '); "Onclick =" lb_delete_Click "Text =" delete "> </asp: LinkButton>
</Td>/tr>
</ItemTemplate>
</Asp: ListView>
2.
Copy codeThe Code is as follows:
Protected void lb_delete_Click (object sender, EventArgs e)
{
LinkButton lbdelete = (LinkButton) sender;
BLLAccount bll_updateBalance = new BLLAccount ();
If (hd_vehiclecode.Value! = "" & Lbdelete. CommandArgument! = "")
{
If (bll_updateBalance.deleteBalance (hd_vehiclecode.Value, lbdelete. CommandArgument) = true)
{
This. ClientScript. RegisterStartupScript (this. GetType (), this. Title, "alert ('deleted successfully! '); ", True );
Datebind ();
}
Else
{
This. ClientScript. RegisterStartupScript (this. GetType (), this. Title, "alert ('deletion failed! '); ", True );
}
}
}