Unable to display this Web Part. SharePoint 2010 Data View Web Part issue.

Problem:

On our intranet, we have been constantly getting the following errors on pages that contains a Data View Web Part. Although I said constantly, it doesn’t mean that the error shows on a page all the time. It meant that a page sometimes works sometimes doesn’t. But if it doesn’t, it will show that error message. The inconsistant of the error makes it more difficult to debug and the log file wasn’t helpful either.

Data View Web Part Error

After searching online, a few people has had the same problem. Someone said it had something to do with a SharePoint Update and suggested to install a hotfix, but we didn’t have that update installed so we didn’t want to try the hotfix. Another post mentioned that adding the “AllowPersonalization” property to a web part zone should fix the problem. However, it didn’t say how to add this property.

Solution:

Open up the root site in SharePoint Designer. From the left Navigation pane, choose Page Layouts. I had a custom Page Layout used by those pages that displays the Data View Web Part, so I opened that page layout. Follow the prompt and check it out. Click the “Advanced Mode” button on the top ribbon. In your code, search for “WebPartPages:WebPartZone” and inside that tag, add AllowPersonalization=”true”.

For example:

<WebPartPages:WebPartZone id="g_9973D18452754B25AAF6B1DBDC75CF6A" runat="server" AllowPersonalization="true" title="Box 1"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>

After editing the page layout, make sure to check in and publish it.