I have customized the "EditProfile.aspx" page and want to deploy it on the QA using a Feature, is it possible to deploy a page under the "_Layouts" folder using feature.

Tried with the below Feature


<Feature  Id="C8F0E2DA-846D-43c0-84B1-56463178E91A"  Title="My Custom Pages"  Description="My Custom Pages"
  Scope="Web"  Hidden="True"  xmlns="http://schemas.microsoft.com/sharepoint/">
    <ElementManifest Location="Elements.xml" />  


<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="Pages" Path="PageTemplates" url="_Layouts">
        <File Url="EditProfile.aspx" Type="GhostableInLibrary" />

It is throwing an access denied error message when try to activate the feature.

Is that it can be done only through the solution package?

1 Answer 1


The _layouts folder isn't a library like the masterpages or webpart galeries. So you shouldn't use a module to provision the files.

Just add the files that have to be deployed to the layouts folder to your solution manifest file under the TemplateFiles element:

<Solution SolutionId="1242CAD1-692B-4A66-AC93-1565FE7C34E6" ResetWebServer="True"
  <!--Feature Manifest files-->
    <FeatureManifest Location="Featurename\feature.xml" />
  <!--TEMPLATE files-->
    <TemplateFile Location="CONTROLTEMPLATES\FeatureName\Action.ascx" />
    <TemplateFile Location="IMAGES\FeatureName\delete.gif" />
    <TemplateFile Location="LAYOUTS\FeatureName\EditProfile.aspx" />

As you can see, I've added a file to the _controltemplates, _images and _layouts folder. Note that I've placed each file in a subfolder with the feature's name, this is a best practice to keep your files seperated from other features and the default sharepoint files.

If you're not using WSPBuilder or another tool to create your DDF file, don't forget to add your files there too:

.Set DestinationDir=CONTROLTEMPLATES\FeatureName

.Set DestinationDir=IMAGES\FeatureName

.Set DestinationDir=LAYOUTS\FeatureName

With 12\Template\Layouts\FeatureName\EditProfile.aspx the path in my current solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.