# How to deploy an aspx to subsite from VS 2010

Is there any chance to achieve this? The sharepoint project and the silverlight web part, which is called by the aspx, are linked by this template. I played with module and feature xml files but i couldn't manage to deploy the aspx to subsite.

unedited version of elements.xml of the module:

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

-
Have you added the aspx file to your module, aswell as add that module to a feature? That's what I did to get my site template working. Might be stupid questions but I just wanted to make sure that I understand what you've done so far. –  K.W Feb 9 '12 at 9:41
I have added both of them. It deploys the aspx to site collection site pages library with the default elements.xml above. –  onatm Feb 9 '12 at 9:45

Where are you storing this aspx file ? Mostly, aspx files are stored in the layouts folder, although they can also be stored in pages (or any other) libraries.

If you want it to go into _layouts folder, nothing has to be done for subsites.

If you want it to be stored in a library on subsite level, please provide the elements.xml file from your module. This way we can check what might be going wrong.

This is what my module looks like:

 <Module Name="MasterPage" Url="_catalogs/masterpage" RootWebOnly="TRUE">
<File Path="MasterPage\bekaert.blue.master" Url="bekaert.blue.master" Type="GhostableInLibrary">
<Property Name="ContentType" Value="\$Resources:cmscore,contenttype_masterpage_name;" />
<Property Name="UIVersion" Value="4" />
</File>
</Module>


So the Url property of the Module will be the List to where u need to provision. The Path property of the File is the location in your solution. The Url property of the file is the location to store it. (in my example it will be in the root of masterpage libary, if you want it to be in a subfolder u can use: Url="subFolder/..." for the File Url property)

So for sitepages this Module Url should be "SitePages":

Thanks

-
i edited the question to reply yours. –  onatm Feb 9 '12 at 8:43
I updated my answer, You need to specify the Url in ur Module as mentioned on msdn.microsoft.com/en-us/library/ms441170.aspx –  Frederik P. Feb 9 '12 at 15:12