1

I have a grid view with check boxes in a template field that are used to delete one or more rows at a time. I then have a button that posts back to the server and deletes any row with a checked checkbox. That works fine. I recently added a button that automatically deletes all the rows by checking every box with JavaScript and then posting back and running the same function to delete rows that are checked. This also works, but then after that (using my 'Delete All Button'), any other post back causes an event validation error, which I presume is caused by using JavaScript to check all my boxes.

Error:

Unhandled exception at line 885, column 13 in PageOmitted

0x800a139e - JavaScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

First off, it's strange to me that the error pops up on the next post back, rather than the one causing the issue. But my question is what can I do to get past the event validation? Is there an easy way to do that? I looked at the 'RegisterForEventValidation' method mentioned in the error on MSDN, but I couldn't make heads or tails of that...any options?

Daniel Ecker
  • 105
  • 13

0 Answers0