Invalid postback or callback argument
-
I have a web page in which there is GridView binded with some records. There are two buttons i.e. delete button and update button in the grid. Now When i click delete button, then the RowCommand event fires and it works perfectly. But when I click on update button to update the current row and then clicks on delete button to delete any row, then the following error occurs : 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 I have also used "EnableEventValidation='False'" in the page.aspx but still getting same error .. Kindly help ASAP
-
I have a web page in which there is GridView binded with some records. There are two buttons i.e. delete button and update button in the grid. Now When i click delete button, then the RowCommand event fires and it works perfectly. But when I click on update button to update the current row and then clicks on delete button to delete any row, then the following error occurs : 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 I have also used "EnableEventValidation='False'" in the page.aspx but still getting same error .. Kindly help ASAP
Since the sever generated the object, it expects to have full control over it. So the delete has to delete in the server side post back, and then rendered again on page load. It's a security issue in asp.net. You can wrap the object in an update panel, and so a small ajax trip to the server and back, while maintaining server side control.