Thursday, 26 June 2008

RegisterDataItem can only be called during an async postback Error

I received the above error whilst using a ajax popup extender. Originally the popup extender was within an update panel and worked fine, the second I removed the update panel I started to get the issue.

The problem turned out to be this line:-

PopupStatusImage.Cancel();

which basically tells the popup extender to hide. You can only call .Cancel() or .Commit() if your popup extender is within an update panel!

You can simply check the Script manager to see if its a partial post back if you need to keep the cancel in for some pages etc.

Hope this helps someone.

No comments: