Thursday 14 August 2008

Invalid postback or callback argument in ASP.Net 3.5

Also, you might get a Sys.WebForms.PageRequestManagerServerErrorException with code 500 when using Ajax. It usually happends when you click on a button in a GridView or another bound control. You expect it to work, but it doesn't, even if the code is relatively clear.

The answer is (probably) that you are binding the container bound control every time you load the page (instead of only on !IsPostBack). The thing is this used to work in ASP.Net 2.0.

Bottom line: check your binding, see if you are not doing any DataBind in between the button click and the eventual event catch.

12 comments:

  1. Hey, this was a very helpful post.. that problem was a real head scratcher for me, but you showed me the way :) Thanks much!

    ReplyDelete
  2. Thank you. Fixed my problem exactly as you described.

    ReplyDelete
  3. joseph jelasker22 April 2009 at 04:22

    hey,really i was very helpful for me.
    within simple snippet of information you have solved my problem.Thanks a lot

    ReplyDelete
  4. Great post! I've been scratching my head on this one for a while. Thing was, on some of my pages it worked and others it didn't. I'd been scouring over the differences between them for a while and I guess it wasn't obvious enough. Thanks for this!

    ReplyDelete
  5. Hey there,

    I couldn't go off this post without thanking you. You saved me from a horribly embrassing meeting. I had to get this thing done and got stuck with very problem you addressed.
    You rock bud

    ReplyDelete
  6. thank you man it is realy helpful for me also

    ReplyDelete
  7. Saved me a ton of time - thanks!

    ReplyDelete
  8. This is an awesome post. It saved my life.

    ReplyDelete
  9. Robert Firegarden6 October 2011 at 19:34

    Bravo... simply Bravo!

    ReplyDelete
  10. Bravo! Simply Bravo.
    Slow clap..... clap..... clap

    ReplyDelete
  11. I have used ispostback for binding but still have got the error twice in between and it's not reproduced now.. :-(

    ReplyDelete