2

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?

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

oooh.. So there is inconsistency between what is postback. I think the controlsIDs are all named. I will see what controls i dont regenerate..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.