0

(I have also asked this question on Stack Overflow)

I have a SharePoint feature I'm using to add some custom aspx files to the Pages Library.

When I activate the feature, I can visit the pages in-browser and they are visible in SPDesigner, but when I "View All Site Content" they are not there.

Why is this the case?

The Feature's Elements File:

<?xml version="1.0" encoding="utf-8"?>
<Elements Id="9e85eb79-6d8d-4ff3-b0d4-64d55c3bb577" xmlns="http://schemas.microsoft.com/sharepoint/">
    <Module Name="Pages" Url="Pages">
        <File Path="Example.aspx" Url="Example.aspx" IgnoreIfAlreadyExists="False">
            <Property Name="Title" Value="The Example" />
            <Property Name="ContentType" Value="Page" />
        </File>
    </Module>
</Elements>

The Aspx File:

<%@ Page language="C#" Inherits="System.Web.UI.Page,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" MasterPageFile="~masterurl/default.master"%>
<%-- deliberately left empty -->

(yup, it's empty!)

Addendum

When I "visit the pages in-browser" I mean navigate to their URLs manually: http://myserver:PORT/subsite/Pages/Example.aspx

When I "View All Site Content" I am looking at the contents of the "Pages" list: http://myserver:PORT/subsite/Pages/Forms/AllItems.aspx

1
  • Can you see the pages library document count and compare that with the number of documents that you actually see? Jul 28, 2010 at 17:58

2 Answers 2

1

The File Node should have Type="GhostableInLibrary", because "Pages" is a document library. When ever you provision a file in a document library you need to have ghostableinlibrary set.

eg:

<?xml version="1.0" encoding="utf-8"?><Elements Id="9e85eb79-6d8d-4ff3-b0d4-64d55c3bb577" xmlns="http://schemas.microsoft.com/sharepoint/">    <Module Name="Pages" Url="Pages">        <File Path="Example.aspx" Url="Example.aspx" Type="GhostableInLibrary" IgnoreIfAlreadyExists="False">            <Property Name="Title" Value="The Example" />            <Property Name="ContentType" Value="Page" />        </File>    </Module></Elements>
0

What is the URL you are using to 'view the pages in-browser'?
What is the URL you are using when you 'View All Site Content"?

 Tim

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.