i'm trying to open 2 browser tab ,in the first one i delete a row in webdatagrid and then i go back to the second tab and commit the the deleted record id get this error :
MicrosoftAjaxWebForms.js:6 Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Requested record cannot be found by key.Common Causes:- The data key field(s) is being edited causing the record not to be found when trying to update.- Not rebinding the grid when there are updates to be committed (assuming DataViewState is disabled in this case) – for instance if the grid is bound on !IsPostback.- While a user is editing a particular row in the grid, another user deletes the record from the database. On posting back, the grid is rebound to the updated datasource which no longer contains the record, resulting in the exception.- Changing completely or filtering the grid’s datasource before all CRUD operations are carried out – this is quite common when using other controls on the page to do this . This is partly due to the fact that control events such as SelectedIndexChanged for a dropdownlist or Click for a button fire before the updating events. Changing the grid’s source should in such cases be delayed for later (PreRender). at Function.Error.create (ajax.aspnetcdn.com/.../MicrosoftAjax.js:6:2736) at Sys.WebForms.PageRequestManager._createPageRequestManagerServerError (ajax.aspnetcdn.com/.../MicrosoftAjaxWebForms.js:6:11490) at Sys.WebForms.PageRequestManager._parseDelta (ajax.aspnetcdn.com/.../MicrosoftAjaxWebForms.js:6:29608) at Sys.WebForms.PageRequestManager._onFormSubmitCompleted (ajax.aspnetcdn.com/.../MicrosoftAjaxWebForms.js:6:25637) at Array.<anonymous> (ajax.aspnetcdn.com/.../MicrosoftAjax.js:6:307) at ajax.aspnetcdn.com/.../MicrosoftAjax.js:6:51370 at Sys.Net.WebRequest.completed (ajax.aspnetcdn.com/.../MicrosoftAjax.js:6:89678) at XMLHttpRequest._onReadyStateChange (ajax.aspnetcdn.com/.../MicrosoftAjax.js:6:84277)
Hello,
Thank you for posting in our community.
This is expected behavior if there are more clients (tabs in this case). Since the change is already done on the server by one of the tabs when the other one commits the same row, this exception is thrown since the row no longer exists in the data source. Please note the third common cause in the exception message:
- While a user is editing a particular row in the grid, another user deletes the record from the database. On posting back, the grid is rebound to the updated datasource which no longer contains the record, resulting in the exception.
Please let me know if you need any further assistance with this matter.