This post covers yet another nightmare that I had faced while working on one of the “terrible” areas in SharePoint. Yep – this post will cover Data View Web Part. The reason why I call it “terrible” is not because it is difficult to understand; it’s because with Data View Web Part(DVWP), one tends to run into problems that are difficult to solve, OR have unknown reasons behind them. The root cause behind this? The shared error message is very generic.
I faced a similar problem sometime ago. Let’s take a look at it; this problem could serve as a limelight for a few others that encompass the same issue.
The Problem
In this particular situation, the Data View Web Part inserted on a page displays an error message instead of the actual content. The error message is:
We faced this issue after deploying the SharePoint Site from one location to another through Site Backup-Restore methodology AND the first time a NON-Site Collection Administrator logged into the page where the web part is hosted. The second a site administrator logs in and logs off, and then signs in again as the normal user, the error is gone.
It wasn’t just this; the error comes back again, inconsistently. Every time, though, it gets resolved immediately after the swap of logins. The log files were also not helping much. Below is a snapshot of what the log file message looked like.
Here is a related link which explains the same problem. The proposed solution here is to remove and add the user to the security group OR to the site directly.http://social.technet.microsoft.com/forums/en-US/sharepointgeneral/thread/7bbe8087-bd12-4ace-9fa5-578f6fdb4217
We tried their solution – and it did not help us.
Solution
This error occurs when the “AllowPersonalization” property of the Web Part Zone is set to false, and a user with less privilege tries to access the zone. This leads to the WebPartPageUsageException. This could be overcome by just setting the AllowPersonalization property to true.
NOTE: Please respond if anyone has a different thought on the whole topic.