I had a problem today using a custom control with button. Clicking on the button gave me the following error:
“Invalid postback or callback argument.
Event validation is enabled using <pages enableEventValidation="true"/> in configuration or
<%@ Page EnableEventValidation="true" %> in a page.
This verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid then ClientScriptManager.RegisterForEventValidation method to
register the postback data for validation.”
I added
<%@ Page EnableEventValidation="true" %>
After that i tried overriding Page.Render and adding the
ClientScriptManager.RegisterForEventValidation(btnSubmit.UniqueID)
finally got it working by setting validation to false too
<%@ Page EnableEventValidation="false" %>
hope it helps others also.