0

I was using button click event to bind the data into gridview and used templatefield to modify one of the column to make it clickable but when I bind the gridview on a page load, it shows the data and I can click the data that needs to be clicked but the problem occurs when I click the data. It says 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.

I don't know what is happening here because it was working fine when using a button to trigger the gridview

Sushan Limbu
  • 43
  • 1
  • 8

1 Answers1

0

I fixed it now. I simply had to create a new method called BindGridview() then use if (!IsPostBack) to call that method and it works fine now :D

Sushan Limbu
  • 43
  • 1
  • 8