Im learning to use a gridview and a problem that im seeing is that putting an edit command in the gridview so that I can update a particular row. When I click the edit, it turns to the update as expected, I hit the update and the particular field turns the row into editable textboxes which is expected. The problem that I notice is that if I click another row, I get this error:
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.
My question is why is this error occuring? Here is my code gridview below:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="ProductID" HeaderText="ProductID" />
<asp:BoundField DataField="Product" HeaderText="Product" />
<asp:BoundField DataField="Price" HeaderText="Price" />
<asp:CommandField ShowEditButton="true" />
</Columns>
<SelectedRowStyle BackColor="#99CCFF" />
</asp:GridView>