Wednesday, June 30, 2010

Sys.InvalidOperationException: Could not find Updatepanel... blah, blah, blah

Okay, okay so I know every other developer that has a blog probably has one of these articles too, but I figured I'd throw my 2 cents in also and report on my specific encounter with this issue/situation. This was happening to me on a page where I had a dynamically visible insert form with a gridview displaying data. The insert form was inside of an update panel, and the gridview was not. The gridview had a couple of custom columns where I was doing some neato-fancy stuff. One such column was using a couple update panels for an embeded datalist from a related table and a popup calendar extender. Anyway upon clicking the insert button, I would get the whole "...Could not find Updatepanel..." error message. although the data would insert and the gridview would update just fine.

Now, of course the rest of the error message went on to read, "...if it is being updated dynamically then it must be inside another updatepanel...". Yeah, right, like that'll fix it! Me being the skeptical developer that I am, from the heady days of C/C++ on UNIX/AIX and the messages you would receive from that, I wasn't about to put alot of stock in an error message, let alone one from Microsoft. However, I figured I'd give it a try and dropped my gridview into an update panel. Well, whadayaknow, the error message disappeared and everything is now operating smoothly. So kudos to Microsoft for coming up with an error message that acutally helped to resolve the issue this time. Hopefully, this helps someone else who runs into something similar, or at least gets a couple laughs.

No comments:

Post a Comment