GridView1激发了未处理的事件“RowDeleting

今天项目遇到一个小问题,在GrdiView RowCommand事件删除一个数据提示 激发了未处理的事件RowDeleting

先看代码:

1    < asp:Button CommandName = "delete "  CommandArgument = ' <%#Eval("DeliveryID") %> '  ID = " btnDelete "
2    runat = " server "  Text = " 删除 "  OnClientClick = " return confirm('确定删除吗?') "   />

 

 注意看CommandName 定义为delete 因为该值(“delete”)是微软的默认值,它默认会触发RowDeleting事件。

修改为:

1    < asp:Button CommandName = " del "  CommandArgument = ' <%#Eval("DeliveryID") %> '  ID = " btnDelete "
2    runat = " server "  Text = " 删除 "  OnClientClick = " return confirm('确定删除吗?') "   />

 

这个只要和微软定义规则不同就OK!!! 


 

你可能感兴趣的:(GridView)