Invalid postback or callback argument - using ajax in a user control with dropdown

Last post 09-28-2008 11:44 AM by aspd. 4 replies.

Sort Posts:

  • Invalid postback or callback argument - using ajax in a user control with dropdown

    03-12-2008, 7:11 AM
    • Member
      334 point Member
    • Master81
    • Member since 06-14-2006, 9:49 AM
    • Posts 153

    Hi

    In a user control I have a way of switching between a droplist that contains american states in a dropdown list or a a standard textbox if the country selected is not US. If any other value is selected besides US, the textbox is set to visible=true and vice versa.

    I have added the american state droplist and textbox (in the event of the country not being US) in an update panel. The country dropdown list is outside the updatepanel and so therefore have implemented an async trigger with the event name as "selectedindexchanged".

    I am getting back this error:

    "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 have tried doing this without a user control and have added it on the page and it works so can't understand when I add this into the user control, it won't work.

    I have researched this and it appears to be a common problem, I have tried adding "eventvalidation=false" in the web.config but still no joy.

    Many thanks in advance.

  • Re: Invalid postback or callback argument - using ajax in a user control with dropdown

    03-12-2008, 8:50 AM

    1. May be you forgot to write ispostback in pageload.

    2. your web.config file doesn't have references to ajax controls

    Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.
  • Re: Invalid postback or callback argument - using ajax in a user control with dropdown

    03-12-2008, 9:47 AM
    • Member
      334 point Member
    • Master81
    • Member since 06-14-2006, 9:49 AM
    • Posts 153

    Ok just tried this in a page without using validation and it works! However, I want this to work in a page that has validation, anyone got any clues?

  • Re: Invalid postback or callback argument - using ajax in a user control with dropdown

    03-12-2008, 12:36 PM
    • Member
      334 point Member
    • Master81
    • Member since 06-14-2006, 9:49 AM
    • Posts 153

    anyone?

  • Re: Invalid postback or callback argument - using ajax in a user control with dropdown

    09-28-2008, 11:44 AM
    • Member
      38 point Member
    • aspd
    • Member since 08-26-2007, 5:40 PM
    • Posts 518

    i am getting the exact same problem. :( Did you work it out yet? It works when i do it without ajax. With ajax, it's a problem

Page 1 of 1 (5 items)