Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.xml

<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/">
  <ElementManifests>    
    <ElementManifest Location="Elements.xml" />  
  </ElementManifests>
</Feature>

Element.xml

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

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?

share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

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"
 xmlns="http://schemas.microsoft.com/sharepoint/">
  <!--Feature Manifest files-->
  <FeatureManifests>
    <FeatureManifest Location="Featurename\feature.xml" />
  </FeatureManifests>
  <!--TEMPLATE files-->
  <TemplateFiles>
    <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
12\TEMPLATE\CONTROLTEMPLATES\FeatureName\Action.ascx

.Set DestinationDir=IMAGES\FeatureName
12\TEMPLATE\IMAGES\FeatureName\delete.gif

.Set DestinationDir=LAYOUTS\FeatureName
12\TEMPLATE\LAYOUTS\FeatureName\EditProfile.aspx

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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