搞了很长时间了,如何在listview button上添加事件监听,一直是网友们比较在意的,本文将为您解答此疑惑,需要了解的朋友可以参考下
1.
‘ onclientclick=”return confirm(‘确定删除此条信息?’);” onclick=”lb_delete_Click” text=”删除”>
<
代码如下:
<
/tr>
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(‘删除成功!’来源gaodai#ma#com搞@@代~&码网);”, true);
Datebind();
}
else
{
this.ClientScript.RegisterStartupScript(this.GetType(), this.Title, “alert(‘删除失败!’);”, true);
}
}
}
{
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(‘删除成功!’来源gaodai#ma#com搞@@代~&码网);”, true);
Datebind();
}
else
{
this.ClientScript.RegisterStartupScript(this.GetType(), this.Title, “alert(‘删除失败!’);”, true);
}
}
}
以上就是listview里的button事件添加方法的详细内容,更多请关注gaodaima搞代码网其它相关文章!