You must Sign In to post a response.
  • Category: ASP.NET

    Getting "Invalid postback or callback argument" error.

    Hi Coders,
    I have one textbox in which I am entering person name following that i am adding Region, Country, Area for that person. I am binding this Region, Country, Area cascading dropdowns at client side using Ajax call web method, but when i am trying to save this record i am getting error-

    Invalid post back 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 post back or callback data for validation.

    if any one have idea please help me.
    Thanks in advance.
  • #764285
    Please check the following

    Mostly this issue will happen because of the validation security issue.

    By default we are doing the following for the for all the pages.


    This is because we are not allowing any html code and script code for the post back. If we allow the above two user can run any code in our page. So that we are enabling this .

    So please check in your input. Are you sending any script or html code in your text boxes. And also your doing ajax call. So make sure are you handling there also.

    By Nathan
    Direction is important than speed

  • #764287
    Its AJAX post back error, try setting EnableEventValidation="false". OR
    <%@ Page EnableEventValidation="false" %>
    it may resolve your issue.
    if not resolved then More ever use 'Use ASP.NET Ajax UpdatePanel' in your aspx file, it will save client side code as well as postback too.

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #764305
    Hai Gorakh,
    I think, you can use the ScriptManager and keep your control inside UpdatePanel so that the refresh will not happen and your code should work fine.
    Hope it will be helpful to you.

    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)

  • Sign In to post your comments