<p>I am getting the following error when an event (Add/Edit/Delete) occurs on my databound control.</p>

<blockquote>
  <p>Invalid postback or callback argument.
  Event validation is enabled using in
  configuration or &lt;%@ 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.</p>
</blockquote>

<p>I am using a custom DataList control, but this problem also occurs with GridView, DetailsView, FormView and Repeater control (and maybe with other databound controls).</p>

<p>The answers I can find tell me to turn off the validation in the config file or page, but that does not sound like it is the best solution. What am I doing wrong?</p>

The problem is loading the data for the control in the page Load event and calling the  DataBind() method. However it appears that if the DataBind() method is called before the events are raised the above exception is generated as the control naming has changed.
The solution is to change this to if(!IsPostback) DataBind() and then call the DataBind() method at the end of the event handler. You would need to call it most of the time anyway at the end of the handler to affect the changes.
If this is not your problem, and you are modifying controls client side using JavaScript, check out
this article
.
This is a self answered post as I was getting a lot of responses on my blog to this issue and thought I might share it further.