The default Dynamic Data application uses AJAX partial rendering (using an UpdatePanel), which make browser post backs feel smoother. One downside is that it can also make it harder to diagnose some error conditions.
The purpose of this post is to tell you how to see the real error behind it. When reporting a Dynamic Data issue, please make sure you always do this as reporting a PageRequestManagerServerErrorException gives little information about what’s going on.
Stepping back a little, there are two main categories of errors that your Dynamic Data app can run into:
- Errors that get handled by validator controls: those get displayed inside the page, either inline (e.g. in a GridView cell) or at the top of the page (where the asp:ValidationSummary is), or often in both places.
- Unhandled errors: those normally result in an ASP.NET runtime error page, which typically have a yellow background and include a clear error message and a stack trace.
The problem is that when using AJAX partial rendering, unhandled errors turn into those cryptic PageRequestManagerServerErrorException, which basically don’t tell you what’s wrong.
Of course, there is no guarantee that this error will make complete sense, but at least you’ll be looking at the real error, and if you report it (e.g. to the forum), there is a good chance that someone can help with it.
When you’re done debugging the problem, feel free to set EnablePartialRendering back to true, unless you don’t care for it.
As an aside, not that even though I’m writing this in the context of Dynamic Data, everything in this post applies to any ASP.NET application that uses AJAX rendering. It’s just that Dynamic Data has it on by default, and since you didn’t have to explicitly turn it on, you may not know that it’s happening.