SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a page with a DataFormWebPart setup to display some data from a subweb. The page is setup ok, the webpart is working. In my solution, I need to create the subweb (that's already working ok) and then place the DataFormWebPart on the default page of the current site.

I was trying to do this declaratively via a module, but that doesn't seem to work. I've tried this approach:

<Module Name="MyOrgPages">
<File Path="MyOrgPages\Home.aspx" Url="SitePages/Home.aspx">
  <AllUsersWebPart WebPartOrder="0" WebPartZoneID="Left">
    <![CDATA[<?xml version="1.0" encoding="utf-8"?>

But SharePoint keeps complaining it doesn't understand the content of the webpart. I got the contents by exporting the webpart to a .webpart file and copying the contents of that file.

So is this actually the correct way to do this, and if so: what could be the cause of my problem?

share|improve this question

Ah stupid. You need to include <webParts> </webParts> inside the CDATA bit, otherwise it doesn't work.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.