# aspx page in module and ghosted web parts

I am making a webtemplate. This webtemplate activates a hidden feature which contains a module, deploying the default.aspx page.

The module looks like this:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="salessiteFiles">
<File Path="salessiteFiles\default.aspx" Url="default.aspx">
</Module>
</Elements>


Inside the .aspx page, I have placed a webpart, defined like this:

<SalesWP:SalesWP runat="server" ID="g_b3f403fc_d209_45fd_be6f_6831c665aa1f" ....


When I create a site using my own template, the web part is present, but it appears to be 'ghosted' in some way; the WebPartManager can't find it, and if I open the default.aspx via SPD, the webpartzone is empty. I need to be able to access the webpart via a webpartmanager.

-

I think that you should not to add web part to the page directly, instead of it you should use web part provision. You can start your research from this posts:

-
That appears to work! At first I wanted to avoid this method because I read a blog post saying that the ID property of the web parts didn't work (and I need that ID for the webpartmanager) but everything appears to be in order. –  Spongeroberto Squarepantalones Dec 12 '12 at 14:37