Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

DataView WebPart - in Feature

  Asked By: Anderson    Date: Jun 17    Category: Sharepoint    Views: 2337

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.

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on DataView WebPart - in Feature Or get search suggestion and latest updates.




Tagged: