添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Dear All,,
Kindly check my issue:
I have been dealing with this bug for about two weeks and I NEED to solve it.
I have read every article available over the internet,but no result ,still the bug appears.I'm sure the solution is going to be very silly.I have a gridview inside an updatepanel,While sorting or paging I don't get the error,I only get it when I click on an Imagebutton or Linkbutton(Delete,Update):
So please check it:
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. Stack Trace: [ArgumentException: 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.] System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +340 System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) +69 System.Web.UI.WebControls.CheckBox.LoadPostData(String postDataKey, NameValueCollection postCollection) +74 System.Web.UI.WebControls.CheckBox.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +13 System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +357 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1768 1. Check your buttons ClientIdMode. Have you change their value to static or something else ? Try the default value.

2. Try in Page_Load to register your controls async:
ScriptManager sm = ScriptManager.GetCurrent( this .Page); sm.RegisterAsyncPostBackControl(YourButton);
and then refresh your update panel programmatically: updatePanel.Refresh();

3. Put your buttons as triggers to your update panel:
ASP.NET
< asp:updatepanel xmlns:asp =" #unknown" > < triggers > < asp:asyncpostbacktrigger controlid =" YourButton" eventname =" Click" / > < /triggers > < /asp:updatepanel > And i see that in your error there is something about a CheckBox. Do you have one on your Page ?
Hey incaunu,
Thank you for replying,When I saw your reply I felt like there was still hope.Because I'm really desperate.
Point 2 and 3 I have tried them but didn't solve the issue.I going to give it another try by doing the three points together.

Yes,I do have checkbox.I use them for multidelete.

Thank you again.
And another ideea, the ClienIdMode of the Checkbox (and all other controls in your gridview control), try Predictable value.

Predictable - This algorithm is used for controls that are in data-bound controls. The ClientID value is generated by concatenating the ClientID value of the parent naming container with the ID value of the control. If the control is a data-bound control that generates multiple rows, the value of the data field specified in the ClientIDRowSuffix property is added at the end. For the GridView control, multiple data fields can be specified. If the ClientIDRowSuffix property is blank, a sequential number is added at the end instead of a data field value. Each segment is separated by an underscore character (_).
Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500
Solution :
< appsettings > < add key =" aspnet:MaxHttpCollectionKeys" value =" 100000" / > < /appsettings > This can be caused if you do not know much about the Asp.Net Page Life Cycle Events. Wrong way of proggramming could lead to this problem.
However there are ways out there to resolve it. This Error happens because Asp.Net Framework could not find the control that caused the
Postback . Thanks buddy....i have got my issue resolved with the help of your solution. basically i have upgraded my application from 1.1 to 4.0 and during that migration i was facing the issue that whenever i click on the grid that is bind it throws me the mentioned error. Hence i have added EnableEventValidation="false" under page directive and it worked like a charm :) thanks a ton.
  • Read the question carefully.
  • Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  • If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  • Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question. Let's work to help developers, not make them feel stupid.
  •