When you delete a single piece of data in a gidview and the confirmation dialog box pops up, you may encounter a puzzling problem. Next, we will post the error below.
Invalid PostBack or callback argument. Event Validation Is Enabled Using < Pages enableeventvalidation = " True " /> 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.
in many cases, this problem is caused by a verification callback error, sometimes it is fun to change <% @ page enableeventvalidation %> to "false", but I have not encountered this problem when deleting data, the following is my practice
I added a button in gridveiw, and added a JS Code in his onclientclick, which is the code of the pop-up dialog box. However, I got rowdeleting IN THE gridview, I wrote the deletion code, but the problem came out. During the test, I put the breakpoint on rowdeleting. However, when I click the delete button, a dialog box is displayed, however, he did not execute the rowdeleting event for me, but immediately appeared. I am puzzled.
later, I didn't use . Instead, I used the delete button (with a button) IN THE gridview ), I wrote the code in the button pop-up dialog box in rowdatabound to continue the test. However, what I didn't think was that he also popped up the dialog box for me, but did not execute the rowdeleting event, no error is reported either. My head is blind again.
I found it online and did not find the reason for this error, however, once I changed the name of the button in to linkbutton, I changed the button to linkbutton. No error occurred and the rowdeleting was executed.
the problem was solved, but I still haven't figured out why ???