国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

listview里的button事件添加方法

2020-01-18 00:20:36
字體:
來源:轉載
供稿:網友
1.
復制代碼 代碼如下:

<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.
復制代碼 代碼如下:

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);
}
}
}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 休宁县| 宁武县| 阿城市| 利辛县| 长治市| 诸暨市| 鲁甸县| 诸城市| 雅江县| 黄大仙区| 合肥市| 鹰潭市| 黄石市| 十堰市| 长治市| 卫辉市| 温州市| 门源| 天全县| 图们市| 墨江| 上饶市| 营山县| 互助| 汉沽区| 柘城县| 河东区| 台州市| 彰武县| 成武县| 德州市| 穆棱市| 六枝特区| 卢氏县| 晴隆县| 怀化市| 大厂| 额尔古纳市| 纳雍县| 确山县| 遂川县|