源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

listview里的button事件添加方法

  • 时间:2022-10-08 03:48 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:listview里的button事件添加方法
1.
[u]复制代码[/u] 代码如下:
<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('确定删除此条信息?');" onclick="lb_delete_Click" Text="删除"></asp:LinkButton> <</td>/tr> </ItemTemplate> </asp:ListView>
2.
[u]复制代码[/u] 代码如下:
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('删除成功!');", true); Datebind(); } else { this.ClientScript.RegisterStartupScript(this.GetType(), this.Title, "alert('删除失败!');", true); } } }
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部