Dmitry Makovetskiyd
Dmitry Makovetskiyd

Reputation: 7053

System.ArgumentException: Invalid postback or callback argument

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?

Upvotes: 2

Views: 1946

Answers (1)

Alex Reitbort
Alex Reitbort

Reputation: 13696

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.

Upvotes: 2

Related Questions