listview里的button事件添加方法
2016-09-17 21:23
211 查看
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);
}
}
}
相关文章推荐
- listview里的button事件添加方法
- ListView里面添加Button之类可点击事件Item不可点击的处理方法
- listview里的button事件添加方法
- Android ListView内的Button添加事件的两种方法
- android中ListView中在Adapter中为Button设置监听事件方法--跳转Activity
- flex4.5 DataGrid 列中添加Button,事件函数中获取外部的方法、属性。
- c# 给button添加不规则的图片以及用pictureBox替代button响应点击事件的方法
- Android开发中在ListView中经常有Item的点击事件及Button或ImageButton等需要被点击的事件之间的处理方法
- listview的item中含有button导致onitemclick事件失效的解决方法
- Android - ExpandableListView的group里添加button后不能展开的解决方法
- Android - ExpandableListView的group里添加button后不能展开的解决方法
- listview中如果存在button imagebutton 等强焦点事件 处理方法
- ListView中添加Button后,Button的点击事件和ListView的点击事件冲突
- ListView中添加Button后,Button的点击事件和ListView的点击事件冲突
- ExpandableListView的group里添加button后不能展开的解决方法
- ListView点击事件失效(item里面有button按钮控件)解决方法
- ListView中添加Button后,Button的点击事件和ListView的点击事件冲突
- Android - ExpandableListView的group里添加button后不能展开的解决方法
- 在ListView中添加Button并且自定义布局和获取输入框中值的方法
- listview 下面添加button方法