This is a migrated thread and some comments may be shown as answers.

Unknown Error with ScriptManager/RadGrid

7 Answers 159 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 09 Dec 2010, 06:47 PM
I use one RadScriptManager as a user control with my menu. Everything has worked fine for weeks. Suddenly I am getting the following error all over the place.

Server Error in '/' Application.
--------------------------------------------------------------------------------
  
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. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
  
Exception Details: System.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.
  
Source Error: 
  
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
  
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) +8627289
   System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) +72
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +35
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
  
   
  
  
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618

This is occuring ever ytime  I am updating a record across multiple RadGrids. If I put error trapping within the procedures I won't get this message. The data is being inserted and updated properly but the web app is failing afterwards. the weird part is that it runs fine on my machine but suddenly when published to another web it fails.

Is there some property that might have inadvertantly gotten changed? I haven't touched it, but it sure seems strange.

7 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 12 Dec 2010, 05:16 PM
Hello David,

Can you always reproduce the problem? If so, can you please capture the request/response of such a failing attempt with FiddlerCap and post a link to the logs here for inspection?

All the best,
Simon
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
William
Top achievements
Rank 1
answered on 13 Dec 2010, 01:52 PM
I was able to track down the cause. In order to speed up some exports to Excel I created a series of predefined queries that I would swap in and out from the grid. While this worked fine for exporting data, when I attempted to update or cancel from my user control I would get the validation error. When I turned off the checking I wouldn't get the error but the user control also pulled up the wrong record.

If you want I could zip up the code and send it to you to look at. For now, I have disabled swapping out sql statements and it is functioning normally again.
0
Simon
Telerik team
answered on 13 Dec 2010, 04:10 PM
Hello William,

Since attaching archives to forum posts is not allowed, could you use an external file hosting service and post a link to the file here?

Best wishes,
Simon
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
William
Top achievements
Rank 1
answered on 13 Dec 2010, 04:41 PM
Do you have a suggested site where I might do that?
0
Simon
Telerik team
answered on 16 Dec 2010, 02:22 PM
Hello William,

Please excuse me for misleading you.

You can open a support ticket and send us the file there. Please also mention this forum thread (with link or ID) so that we can track down the support incident history.

Kind regards,
Simon
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
TonyG
Top achievements
Rank 1
answered on 01 Nov 2011, 07:19 AM
It would be nice to see the results of this inquiry.  I've been stuck on this issue for two days now.  The only common answer I can find in the forum is to use advanced databinding with NeedDataSource.  Well, I am, and I'm still getting the error.  I'll continue looking...

Revised: I found a solution that fits my scenario, dunno if it will help others:
I have an RadGrid with GridTemplateColumn and ItemTemplate > ImageButton.
The issue that triggered the error for me is that each ImageButton had the same ID.
In my grid_ItemDataBound event I now have code like this:

if ( e.Item is GridDataItem )  {
 GridDataItem item = (GridDataItem) e.Item;
  ImageButton btn = (ImageButton) item.Cells[ 3 ].Controls[ 1 ];
  btn.ID = "btnR" + e.Item.ItemIndex; // this is the one-line fix
  ...
}

HTH
0
Simon
Telerik team
answered on 04 Nov 2011, 05:29 PM
Hello Tonyg,

Unfortunately we haven't received a sample that we can debug, so there is nothing new to add. It is good that you have found a workaround, so thank you for sharing it with the community.

Regards,
Simon
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
ScriptManager and StyleSheetManager
Asked by
David
Top achievements
Rank 1
Answers by
Simon
Telerik team
William
Top achievements
Rank 1
TonyG
Top achievements
Rank 1
Share this question
or