listview里的button事件添加方法
来源:互联网 发布:mysql 0 1 true false 编辑:程序博客网 时间:2024/06/14 20:49
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);
}
}
}
复制代码 代码如下:
<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);
}
}
}
0 0
- listview里的button事件添加方法
- Android ListView内的Button添加事件的两种方法
- ListView中添加Button后,Button的点击事件和ListView的点击事件冲突
- ListView中添加Button后,Button的点击事件和ListView的点击事件冲突
- ListView中添加Button后,Button的点击事件和ListView的点击事件冲突
- ListView中添加Button后,Button的点击事件和ListView的点击事件冲突
- listview 的onitemclick事件与item里的button冲突
- ListView里面添加Button之类可点击事件Item不可点击的处理方法
- listview 下面添加button方法
- 【Android】监听ListView里Button事件
- ListView—Item的click事件和Item里的button等子控件的click事件同时生效的解决办法
- 【Android】 ListView添加Button后响应OnItemClick事件以及View TAG的使用。
- ListView 包含Button 的事件问题
- ListView 包含Button 的事件问题
- ListView 包含Button 的事件问题
- ListView中Button的点击事件
- ListView 包含Button 的事件问题
- ListView中Button的点击事件冲突
- 第十一章μC/OS-Ⅱ可裁剪性的实现
- redis:hash数据类型与操作
- 第三周项目一 顺序表的基本运算
- 21分钟 MySQL 入门教程
- 【Spring学习笔记】Spring中的Resource接口
- listview里的button事件添加方法
- 使360浏览器打开网页默认为极速模式
- Android开源项目大全 - 项目类
- 欢迎使用CSDN-markdown编辑器
- [李景山php]ubuntu 14.04.3 LTS 版本 通过 nginx + keepalived 配置 高可用 负载均衡集群演示
- HihoCoder]#1366 : 逆序单词
- Intent
- 字符串比较
- JAVA--装饰器模式