Server Error in ‘/WebSite10’
Application. 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 get that mistake.
Note that: I do generate some controls dynamically and call their events..Why does it happen and how can I prevent it?
You need to regenerate those controls dynamically on each page_load. Even on Postback. You also need to set their Id to the same value each time.