Thursday, August 14, 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:

Anonymous said...

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

Shelly said...

Thank you. Fixed my problem exactly as you described.

joseph jelasker said...

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

Jason S. said...

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!

Anonymous said...

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

Anonymous said...

Thank's

sadık said...

thank you man it is realy helpful for me also

BKahuna said...

Saved me a ton of time - thanks!

Anonymous said...

This is an awesome post. It saved my life.

Robert Firegarden said...

Bravo... simply Bravo!

Robert said...

Bravo! Simply Bravo.
Slow clap..... clap..... clap

sampath online said...

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