I'm trying to deploy a custom web part to SharePoint 2013 On-Premises. I have created the web part (simple web part just an asp:label on it for testing). I also created an ASPX page (without code behind) which is deployed with a module. I can add the web part to the page from SharePoint -> Edit page -> add web part
.
However I want to do this from my module elements file. If I do it, I got import error.
This is my aspx page main content placeholder:
<WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="Top" Title="loc:Top" />
And this is my module's elements.xml:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="PagesModule" Url="Lists/Pages" List="101">
<File Path="PagesModule\CustomerFormPage.aspx" Url="CustomerFormPage.aspx" Type="GhostableInLibrary" ReplaceContent="TRUE">
<AllUsersWebPart WebPartZoneID="Top" WebPartOrder="0">
<![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="CustomerForm.WebParts.CustomerDataWebPart.CustomerDataWebPart, $SharePoint.Project.AssemblyFullName$" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">Customer</property>
<property name="Description" type="string">Customer List WebPart</property>
</properties>
</data>
</webPart>
</webParts>
]]>
</AllUsersWebPart>
</File>
</Module>
</Elements>
Any idea what I am doing wrong?
Thanks in advance!