0

I have got a button field in my grid view. When I click multiple times on the grid (3 times), I am getting an error which is shown below. The same issue is arised when I click multiple times on a page number(which is not the active page) of the grid.

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.

Please help me solve the issue.

KV Prajapati
  • 93,659
  • 19
  • 148
  • 186
user.net
  • 51
  • 3
  • 13

1 Answers1

0

I guess you have added databinding code in page load without enclosing IsPostBack block.

void page_load()
{
  if(!IsPostBack) 
   {
    //put databinding code here
    }
}

EDIT:

Please read these threads/posts:

  1. Invalid postback or callback argument. Event validation is enabled using ''

  2. MSDN blog - Validation of viewstate MAC failed error

  3. Validation of viewstate MAC failed

  4. Validation of viewstate MAC failed error

Community
  • 1
  • 1
KV Prajapati
  • 93,659
  • 19
  • 148
  • 186
  • The databinding is enclosed in (!IsPostback) event. I tried with giving EnableEventValidation="false" for the page. Then another error message is raised which is ------------------------- "Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster." – user.net Sep 20 '11 at 08:59
  • @user.net I'm too! a victim of this. There are different work-around and suggestions. I'm pasting other links on this subject. Hope this will help you out. – KV Prajapati Sep 20 '11 at 10:07