Unknown Error with ScriptManager/RadGrid

8 posts, 0 answers
  1. David
    David avatar
    25 posts
    Member since:
    Oct 2010

    Posted 09 Dec 2010 Link to this post

    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.
  2. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 12 Dec 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. William
    William avatar
    4 posts
    Member since:
    Oct 2010

    Posted 13 Dec 2010 Link to this post

    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.
  5. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 13 Dec 2010 Link to this post

    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.
  6. William
    William avatar
    4 posts
    Member since:
    Oct 2010

    Posted 13 Dec 2010 Link to this post

    Do you have a suggested site where I might do that?
  7. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 16 Dec 2010 Link to this post

    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.
  8. TonyG
    TonyG avatar
    239 posts
    Member since:
    Feb 2006

    Posted 01 Nov 2011 Link to this post

    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
  9. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 04 Nov 2011 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017