Tuesday, September 04, 2007

Sharepoint Service 3.0, Invalid postback or callback argument,Event validation

Defaault is TRUE. if page-postback , a general error message would be:
""
Details message:
(How-to get error message in details:Enable :customError: Off; SafeMode MaxControls="200" CallStack="true" in web.config )

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

Solution:
1.) Make for these controls EnableEventValidation as false.
2.) At the page level also, u can mention EnableEventValidation as false.
3.) At the whole application level, i.e in the web.config also, u can specify EnableEventValidation as false.
4.) All these will harm the security of your application and your machine -- I strongly "dont" recommend this.
5.) Best Solution -- Where you are generating the id's for the controls -- dynamically -- for eg, say -- txtBoxUser = this.Id + " _1" + _txtBox"; check such scenarios -- becoz it is somewhere here where you are generating the similar id's of the controls.
6.) Debug to find this .... the unique ids getting generated. Take care of for loops wherein sometime, the counter's of for loops are the only differentiators for generating the ids of the controls dynamically --typical example -- to determine the row position.
[http://forums.asp.net/t/922994.aspx?PageIndex=8]

No comments: