I have a Repeater with a Button inside the ItemTemplate. I added the CommandName property to the button and registered and event handler for the ItemCommand event on the Repeater.
My problem is that when I click the button, I get an ArgumentException with a message saying something about EnableEventValidation being set to true.
(By the way, is there a way I can get the message in English, instead of a lousy Portuguese translation?)
I tried setting it to false and the ItemCommand handler is not called. If I set it to true I get the error.
The message also says something about using ClientScriptManager.RegisterForEventValidation if I trust the client (which I do). The problem is I can't make sense of the documentation for that method.
lookout for the binding problem pointed out by Steve Robbins and you may also want to take a look at this article which I found pretty useful when I was stuck in a similar situation.
The only time I've ever seen this is when I was rebinding the repeater in the Page_Load on postback, rather than wrapping the binding in an if (!Page.IsPostBack). If you do this then the control that's sending the message is effectively invalid, so it fails.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With