I am attempting to add a delete command to my data grid, and it worked fine on my previous program, but now for some reason is giving me this error message:
Quote:
|
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.
|
The data grid is in this format:
HTML Code:
<asp:DataGrid id=dg runat="server" ondeletecommand="Delete_Item">
<columns>
<asp:buttoncolumn buttontype="PushButton"
commandname="Delete" text="Remove All" />
</columns>
</asp:DataGrid>
and the "Delete_Item" subroutine is here:
Code:
Sub Delete_Item(s As Object, e As DataGridCommandEventArgs)
objDT = Session("Cart")
objDT.Rows(e.Item.ItemIndex).Delete()
Session("Cart") = objDT
dg.DataSource = objDT
dg.DataBind()
End Sub
So this used to remove a row from my data grid, but not anymore.
It would be super if someone could tell me what the problem is.