Click here to Skip to main content
15,867,780 members
Please Sign up or sign in to vote.
2.60/5 (7 votes)
See more:
Sys.WebForms.PageRequestManagerServerErrorException: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> 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.
....




pls give me a fast reply
Posted
Updated 21-Aug-18 4:47am

ScriptManager may not find the control when binding is done in Page_Load instead bining the data to control (like dataset) in Page_PreRender will solve the issue.
 
Share this answer
 
Comments
vedprakash289 10-Jun-12 10:10am    
Thankyou Narsimlu kashagouni it solved my problem thank you very much
Try having EnableEventValidation = false for the page you are having this issue.

Further, make sure your Web.Config file is up with Ajax scripts.
Also, make sure - Scriptmanagers partial rendering is enabled
 
Share this answer
 
Comments
Ali Al Omairi(Abu AlHassan) 17-Feb-11 4:23am    
Sir, How about enabling event validation on control level? do you have any idea for that?

100 :rose: ;)
You could do as the error message suggests and use the ClientScriptManager.RegisterForEventValidation[^] method in order to register the postback or callback data for validation.

Or you could just set EnableEventValidation for the page to false.
 
Share this answer
 
Invalid call back and post back problem

When you are using griedview or datalist or repeater control then when you bind this control then you have to put this in if(!ispostback()){....}

By
 
Share this answer
 
Comments
honey4bee 24-Sep-12 6:25am    
Correct Ans......
using above that resolved my problem
kananjookkwww 4-Dec-12 7:34am    
s
kananjookkwww 4-Dec-12 7:34am    
wwww
kananjookkwww 4-Dec-12 7:34am    
www
in the Page_Load method just put this
if(!IsPostBack)
{
///Your Code....
}
You won't get any error like this.....
 
Share this answer
 
Page_PreRender works .
 
Share this answer
 
v2
Usually the problem resides in your Page_Load code:
If you create control in code-behind, or populate by code-behind a control defined in aspx/ascx page, you must re-create it in Page_Load (always, not only if not IsPostBack)
 
Share this answer
 
Comments
fjdiewornncalwe 6-Sep-12 10:18am    
This question is over 2.5 years old. Please don't add more answers to old questions like this.
My problem was solved when cancel event at end of grid event at server side.
protected void grdEducation_RowEditing(object sender, GridViewEditEventArgs e)
{
  // do your processing ...

  // at end
  e.Cancel = true;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900