Invalid postback or callback argument.

22 posts, 0 answers
  1. balaji
    balaji avatar
    69 posts
    Member since:
    May 2009

    Posted 24 Jun 2009 Link to this post

    Hey people,
    now ive tried to use the radajax panel at a certain time am getting the error as
    "Microsoft JScript runtime error: 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."

    i find no actions take place if i click enableevent validation="false"

    a)may i knw what is the cause of this error?
    b)In Most of the Telerik Demo i find that they have been using sql datasource to bind data to the controls rather than code behind,wuld that be the reason for it?

    Guys this is getting so serious and close pls just give me hint and ill be so greatfull to you all.
    Awaiting for your Swift Reply
    Thanks
    Regards
    N.Balaji
  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 24 Jun 2009 Link to this post

    Hello Balaji,

    Could you please elaborate a bit  more? Any information on your scenario may be of help on resolving that.
    It will be best to isolate the issue  in a sample and open a support ticket where you can send that. Thus we could do our best to help you in resolving the problem.

    Basically the problem you are facing is caused of abnormal change of the ViewState during postbacks. Event validation checks the incoming values in a POST to ensure the values are recognized. In other words, saved hash values in the __EVENTVALIDATION are different from these send through POST method.

    One of the possible, solution is to disable event validation.
    Change this line:    
         
    <@Page ... enableEventValidation="true"  />    
        
    To:    
        
    <@Page ... validateRequest="false" enableEventValidation="false" /> 

    Regards,
    Pavlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. balaji
    balaji avatar
    69 posts
    Member since:
    May 2009

    Posted 24 Jun 2009 Link to this post

    Hi there thanks for your swift reply.
    But you knw while adding those two lines such as page enable event validation and validate request.
    I dont find anything happen my page is getting refreshed.
    and is there any pther way to send zip attachment kindly pls help me coz am not affordable
    Thanks

  5. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 24 Jun 2009 Link to this post

    Hi Balaji,

    I am afraid that the provided information is not enough to determine what have caused the unexpected behavior.At this point I will ask you to open a formal support ticket and send us a simple running project demonstrating the problem (and step-by-step instructions on doing so). In that way we can reproduce and pinpoint the problems you're facing on our side, understand the logic of your application and provide a solution.

    Regards,
    Pavlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Karl
    Karl avatar
    172 posts
    Member since:
    Sep 2010

    Posted 07 Oct 2010 Link to this post

    I have a RadGrid in a RadPanelBar which produces the same error.

    If I leave the page tag at the top of my page to read...

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RadControlTests._Default" EnableEventValidation="true"  %>

    and use the built-in navigation arrows (not the page numbers, they work fine!) for my paged RadGrid, I get the following error...

    Microsoft JScript runtime error: 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.

    but if I change my page tag to read...

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RadControlTests._Default" ValidateRequest="false" EnableEventValidation="false"  %>

    I no longer get the error, but the navigation arrows fail to navigate and nothing happens. Again, the page number navigation works ok.






  7. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 11 Oct 2010 Link to this post

    Hi Karl,

    Can you please make sure that EnableViewState property of the RadGrid / MasterTableView is set to true? Paging with disabled control ViewState is not supported.
    http://www.telerik.com/help/aspnet-ajax/grdviewstateoptimization.html

    Best wishes,
    Pavlina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. joe
    joe avatar
    3 posts
    Member since:
    Sep 2010

    Posted 12 Oct 2010 Link to this post

    i am having the exact situation as Karl, i have a rad grid with paging, sql datasource, ....
    paging works fine as long as i choose the page numbers, but using the graphic controls with the arrows always results in

    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.

     

    the property of the RadGrid / MasterTableView is set to true as recommended.

    i have done everything recommended on this page, but not positive results.

  9. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 14 Oct 2010 Link to this post

    Hello joe,

    Can you verify that the page ViewState is enabled?

    Kind regards,
    Pavlina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  10. joe
    joe avatar
    3 posts
    Member since:
    Sep 2010

    Posted 14 Oct 2010 Link to this post

    the viewstate is enabled for the radgrid
  11. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 15 Oct 2010 Link to this post

    Hello Joe,

    I am sending you a simple working project that is working as expected. Please give it a try and let me know if it helps to resolve the problem. 

    Greetings,
    Pavlina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  12. Karl
    Karl avatar
    172 posts
    Member since:
    Sep 2010

    Posted 29 Oct 2010 Link to this post

    Thanks Pavlina,

    I had a look at the grid definiation and the code behind in your example and implemented it into my grid and it works well. Everything seems to work as it should now.

    I think its a bit odd that some of the functionality of the grid seems to fail if you bind data in the normal way though, rather than on demand.

    Karl
  13. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 01 Nov 2010 Link to this post

    Hi Karl,

    Can you please specify what exactly do you mean by  "bind data in the normal way"? For more information about how to use simple data binding with a RadGrid control, I suggest that you examine this help article.

    Kind regards,
    Pavlina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  14. Karl
    Karl avatar
    172 posts
    Member since:
    Sep 2010

    Posted 01 Nov 2010 Link to this post

    RadGrid1.DataSource = MyDataSource;
    RadGrid1.DataBind();
  15. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 01 Nov 2010 Link to this post

    Hi Karl,

    Note that with this type of binding you need to change the sort direction and switch the pages manually as you will do with the standard MS GridView control in the same scenario.

    If you would like these actions to be performed automatically, consider using advanced binding with NeedDataSource event handling.

    Greetings,
    Pavlina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  16. Aaron
    Aaron avatar
    9 posts
    Member since:
    Jun 2009

    Posted 04 Nov 2010 Link to this post

    I had this issue, but in my case was due to a mistake during my page load, in my case, i was doing the databinding every time the page was loading, so, if i triggered a button inside the grid, since it rebinded again in page load, then the control triggering the event was lost, after fixing that, i resolved this issue.
  17. ala
    ala avatar
    1 posts
    Member since:
    Dec 2010

    Posted 25 Dec 2010 Link to this post

    Hi Aaron,

    could you please explain me how you solved your problem.I am also getting the same error by rebinding the grid on each post back.
  18. Udo
    Udo avatar
    1 posts
    Member since:
    Aug 2010

    Posted 21 Jan 2011 Link to this post

    I had the same Problem and the solution was simple (although it took me a long time):

    In the Page_Load event I was selecting data for the grid in this way:

    Me.MyObjectDataSource.SelectParameter("...").DefaultValue = ...
    Me.MyObjectDataSource.Select()

    It is important NOT to do this if PostBack is active! So the right way is this:

    If IsPostBack = False Then
        Me.MyObjectDataSource.SelectParameter("...").DefaultValue = ...
        Me.MyObjectDataSource.Select()
    End If



  19. Nicolas
    Nicolas avatar
    4 posts
    Member since:
    Aug 2010

    Posted 15 Nov 2011 Link to this post

    In my case, i was calling the RadGrid.Rebind function in my page_load event:

    If(IsPostback)
    {
        RadGrid1.Rebind()
    }

    When I moved the function call into an event handler after the page_load, like a checkbox_CheckedChanged event, evetything went fine.
  20. christian
    christian avatar
    7 posts
    Member since:
    Jul 2011

    Posted 30 Nov 2011 Link to this post

    yes, solved it!

    the event can be 'dataneeded' event:

     protected void RadGrid_OnDataSourceNeeded(object sender, EventArgs e)
            {
               DataTable table = GetTableFromCache();
               RadGridSchadePremieRapport.DataSource = table;
           //now no rebind() or databind() !
            }
  21. Larry
    Larry avatar
    3 posts
    Member since:
    Nov 2011

    Posted 29 Mar 2012 Link to this post

    I just wanted to export a table to Excel using the built-in Export to Excel feature.  I got the same Invalid postback or callback argument error when clicking on the Export to Excel button (a standard feature of the RadGrid).  So, I tried the so called "Advanced Binding" technique (LOL). I can dynamically change the data in the RadGrid but the grid need to be Data bound to see changes. 
    The following works without setting ValidateRequest="false".  I load the Session during the Page_Load.

    protected void rgEmployees_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

            {

               //no databind needed

                if (rblYearSelect.SelectedValue == "thisYear")

                {

                    DataTable employeeDataTable = (DataTable)Session["ThisYearDataTable"];

                    rgEmployees.DataSource = employeeDataTable;

                }

                else

                {

                    DataTable employeeDataTable = (DataTable)Session["PriorYearDataTable"];

                    rgEmployees.DataSource = employeeDataTable;

                }

            }

            protected void rblYearSelect_SelectedIndexChanged(object sender, EventArgs e)

            {

                if (!isLoading)

                {

                    //do databind as needed

                    if (rblYearSelect.SelectedValue == "thisYear")

                    {

                        DataTable employeeDataTable = (DataTable)Session["ThisYearDataTable"];

                        rgEmployees.DataSource = employeeDataTable;

                        rgEmployees.DataBind();

                     }

                    else

                    {

                        DataTable employeeDataTable = (DataTable)Session["PriorYearDataTable"];

                        rgEmployees.DataSource = employeeDataTable;

                        rgEmployees.DataBind();

                    }

                }

            }


  22. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 03 Apr 2012 Link to this post

    Hello Larry,

    Judging by the provided description it seems to me that your export button is ajaxified. In this case, please examine the following link:
    Export from Ajaxified Grid

    Regards,
    Daniel
    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.
  23. Ganapathy
    Ganapathy avatar
    12 posts
    Member since:
    Aug 2012

    Posted 26 Sep 2012 Link to this post

    validateRequest="false" enableEventValidation="false"

    Setting the above at page level fixed my issue.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017