[英]RowCommand in GridView raises multiple events on click
来自德国的一个愉快的下午,
我在具有RowCommand事件的行上有一个asp:GridView和ButtonFields。
protected void gridView_RowCommand(object sender, GridViewCommandEventArgs e)
{
switch (e.CommandName)
{
case "FirstButton":
this.DoSomething();
break;
case "SecondButton":
this.DoSomethingElse();
break;
}
this.BindDataGrid();
}
我的问题是,在我点击ButtonField的所有案例中,有90%以上是此事件引发的。 问题是在我执行this.DoSomething()
或this.DoSomethingElse()
,特定行无法被执行。
谢谢
渣
你为什么叫this.BindDataGrid? 没有这个,您的解决方案将无法工作吗? 这将导致第二次执行rowcommand。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.