none
WebPartPage 抛出404 错误 RRS feed

  • 问题

  • Hi All,

    我做了一个测试的WebPartPage, 目录结构是:FEATURES\DemoFeatur\CustomSitePageTemplate\CustomWebPartPage.aspx.

    elements.xml 如下:
    <?xml version="1.0" encoding="utf-8" ?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <Module  Path="CustomSitePageTemplate" Url="SitePages">
        <!--<File Url="CustomSitePage.aspx" Type="Ghostable"/>-->
        <File Url="CustomWebPartPage.aspx" Name="CustomWebPartPage.aspx" Type="Ghostable"/>
      </Module>
      <CustomAction Id="SiteActionsToolbar" GroupId="SiteActions" Location="Microsoft.SharePoint.StandardMenu" Sequence="100" Title="SitePage" Description="Custom Menu" RequireSiteAdministrator="True" ImageUrl="_layouts/images/menuprofile.gif">
        <UrlAction Url="SitePages/CustomWebPartPage.aspx" />
      </CustomAction>
      <CustomAction Id="ECBItemMenu" RegistrationType="List" RegistrationId="101" ImageUrl="_layouts/images/GORTL.GIF" Location="EditControlBlock" Sequence="105" Title="Monitor">
        <UrlAction Url="~site/_layouts/CustomApplicationPages/CustomApplicationPage.aspx?ListId={ListId}&amp;ItemId={ItemId}"/>
      </CustomAction>
    </Elements>

    CustomWebPartPage.aspx 的定义如下:
    <%@ Page Language="C#" MasterPageFile="~masterurl/default.master"
        Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c"
        meta:progid="SharePoint.WebPartPage.Document" %>
       
    <%@ Register Tagprefix="WebPartPages"
                 Namespace="Microsoft.SharePoint.WebPartPages"
                 Assembly="Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %>
    <asp:Content ID="main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <h3>Custom Web Part Page</h3>
    <table width="100%">
    <tr>
    <td valign="top" style="width:50%">
    <WebPartPages:WebPartZone ID="LeftZone" runat="server" Title="Left Web Part Zone" FrameType="TitleBarOnly" />
    </td>
    <td valign="top" style="width:50%">
    <WebPartPages:WebPartZone ID="RightZone" runat="server" Title="Right Web Part Zone" FrameType="TitleBarOnly" />
    </td>
    </tr>
    </table>
    </asp:Content>


    Install.bat 的写法是:
    @SET TEMPLATEDIR="C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\TEMPLATE"
    @SET STSADM="C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\BIN\STSADM.EXE"
    xcopy /e /y TEMPLATE\* %TEMPLATEDIR%
    %STSADM% -o installfeature -filename DemoFeature\Feature.xml  -force
    iisreset

    经过编译和执行如下Install.bat后,CustomWebPartPage.aspx 被copy到D:\WorkStation\SharepointDemo\DemoFeature\TEMPLATE\FEATURES\DemoFeature\CustomSitePageTemplate 路径下,GAC中也有相应的DLL。但是我通过SiteAction 的菜单转到这个CustomWebPartPage.aspx,抛出404错误。我尝试了Site Page, it works normally.

    我研究了很久不过没找到原因,希望与大家讨论这个WebPartPage的问题。 我采用的是WSS 3.0
    coolshuo
    2010年3月8日 14:20

答案