I am getting the following error when an event (Add/Edit/Delete) occurs on my databound control.
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 am using a custom DataList control, but this problem also occurs with GridView, DetailsView, FormView and Repeater control (and maybe with other databound controls).
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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…