I am creating a Feature which adds few webparts on the SharePoint page on
activation. I have DataView webpart (created using SPD and works fine)and need
to declare Data Views in a Web Part Page or Page Layout.
I use the "Export" option in the context menu for a Web Part in the browser ,
Copy the XML from the resulting .webpart file inside the CDATA of an
AllUsersWebPart node, but I get error as below. Please guide.
Web Part Error: The file you imported is not valid. Verify that the file is a
Web Part description file (*.webpart or *.dwp) and that it contains well-formed
XML.
Show Error Details
Hide Error Details
[WebPartPageUserException: The file you imported is not valid. Verify that the
file is a Web Part description file (*.webpart or *.dwp) and that it contains
well-formed XML.]
at Microsoft.SharePoint.WebPartPages.WebPartImporter.CreateXdoc(XmlReader
reader)
at Microsoft.SharePoint.WebPartPages.WebPartImporter..ctor(SPWebPartManager
manager, XmlReader reader, Uri webPartPageUri, SPWeb spWeb)
at Microsoft.SharePoint.WebPartPages.WebPartImporter.Import(SPWebPartManager
manager, XmlReader reader, Boolean clearConnections, Uri webPartPageUri, SPWeb
spWeb)
at
Microsoft.SharePoint.WebPartPages.SPWebPartManager.CompressWebPartNoSave(Boolean
isClosed)
I checked my xml but its correct.
Do you know someone who can help? Share a link to this thread on twitter, or facebook.