【问题标题】:MOSS 2007 - Custom Aspx Pages Created With FeatureMOSS 2007 - 使用功能创建的自定义 Aspx 页面
【发布时间】:2011-03-22 05:33:21
【问题描述】:

(我也在SharePoint Overflow上问过这个问题。)

我有一个 SharePoint 功能,用于将一些自定义 aspx 文件添加到页面库。

当我激活该功能时,我可以访问浏览器中的页面并且它们在 SPDesigner 中可见,但是当我“查看所有站点内容”时它们不存在。

为什么会这样?

功能的元素文件:

<?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>

Aspx 文件:

<%@ 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 -->

(是的,它是空的!)

附录

当我“访问浏览器中的页面”时,我的意思是手动导航到它们的 URL:http://myserver:PORT/subsite/Pages/Example.aspx

当我“查看所有网站内容”时,我正在查看“页面”列表的内容:http://myserver:PORT/subsite/Pages/Forms/AllItems.aspx

【问题讨论】:

  • 哈哈-感谢标签编辑:S

标签: sharepoint sharepoint-2007 asp.net


【解决方案1】:

我在 SharePoint Overflow 上得到了答案:

文件节点的类型应为“GhostableInLibrary”,因为“Pages”是一个文档库。当您在文档库中配置文件时,您需要设置 ghostableinlibrary。

例如:

<?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>

所以最后我使用的 XML 是......

<?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" Type="GhostableInLibrary">
            <Property Name="Title" Value="The Example" />
        </File>
    </Module>
</Elements>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-29
    • 2011-04-19
    • 2017-12-10
    • 2014-01-13
    相关资源
    最近更新 更多