删除frm gridview时IndexOutOfRangeException,因为它两次调用gridview事件 [英] IndexOutOfRangeException while deleting frm gridview,as it calls twice the events of gridview

查看:100
本文介绍了删除frm gridview时IndexOutOfRangeException,因为它两次调用gridview事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从gridview和数据库中删除记录时,
它在RowDeleting事件中输入两次,因此第一次可以正确删除记录,但是第二次抛出异常-IndexOutOfRangeException,因为已经删除了记录...

附加信息:
我已使用Updatepanel,并且Grid视图在更新面板中.
是更新面板的问题吗?
如何克服这个错误?
谢谢

While deleting record from gridview and database,
it enters twice in RowDeleting event and hence 1st time it can delete the record properly but second time trows the exception- IndexOutOfRangeException as already the record is deleted...

Additional Info:
I Have used Updatepanel & the Grid view is in the update panel.
is it problem of update panel?
How to overcome this err???
Thanks

推荐答案

这不是正确和预期的行为

这是您在应用程序中的编码缺陷.因此,为了克服它,您需要检查您的代码库,并查看事件如何附加两次并因此执行两次.
This is not the right and expected behavior!

It''s your coding flaw in the application. Thus, In order to overcome it, you need to check your code base and see how the event is attached twice and thus executed twice.


这篇关于删除frm gridview时IndexOutOfRangeException,因为它两次调用gridview事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆