2011-04-04 2 views
1

このtutorail http://msdn.microsoft.com/en-us/library/ff394517.aspxに続いて、aspzページを開くECBをSharePoint 2010用に作成しました。デフォルトでは、aspxページはdefault.masterを使用します。私はminimal.masterを使いたいです。次の行を変更する。 '/' アプリケーションで最小限の.masterを使用しているSharePoint 2010

サーバーエラー:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConvertStatus.aspx.cs" Inherits="Proj.Layouts.Proj.ConvertStatus" DynamicMasterPageFile="/_catalogs/masterpage/minimal.master" %> 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConvertStatus.aspx.cs" Inherits="Proj.Layouts.Proj.ConvertStatus" DynamicMasterPageFile="~masterurl/default.master" %> 

は、次のエラーを取得するために私を引き起こします。私のファイルに私が持っている

コードのみが

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server"> 
    <p>test</p> 
</asp:Content> 

私はminimal.masterを使用することができるはずですか?

更新

コンテンツコントロールは、カスタマー・エラー・モードがオフされた状態でPlaceHolderMain2

ないPlaceHolderMainを言うべきで、私は次のエラーを取得する:

Server Error in '/' Application. 
-------------------------------------------------------------------------------- 

Parser Error 
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: The referenced file '/_catalogs/masterpage/minimal.master' is not allowed on this page. 

Source Error: 


Line 6: <%@ Import Namespace="Microsoft.SharePoint" %> 
Line 7: <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
Line 8: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConvertStatus.aspx.cs" Inherits="MyProj.Layouts.MyProj.ConvertStatus" MasterPageFile="/_catalogs/masterpage/minimal.master" %> 
Line 9: 
Line 10: <asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server"> 


Source File: /_layouts/MyProj/ConvertStatus.aspx Line: 8 

**アップデート2 **

masterpageを含むコード行は、

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConvertStatus.aspx.cs" Inherits="Myproj.Layouts.MyProj.ConvertStatus" DynamicMasterPageFile="~masterurl/minimal.master" %> 

は、この今、次のエラーを生成しますが、私はあなたが使用ContentPlaceHolderIDsは、マスターページ内に存在する必要がありますマスターページ

Server Error in '/' Application. 
-------------------------------------------------------------------------------- 

Content controls are allowed only in content page that references a master page. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Web.HttpException: Content controls are allowed only in content page that references a master page. 

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace: 


[HttpException (0x80004005): Content controls are allowed only in content page that references a master page.] 
    System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +11010974 
    System.Web.UI.Page.get_Master() +69 
    System.Web.UI.Page.ApplyMasterPage() +18 
    System.Web.UI.Page.PerformPreInit() +58 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1256 
+0

あなたはエラーをデバッグするために、あなたのweb.configファイルを変更してみてください:http://blog.thekid.me.uk/archive/2007/02/15/a-solution-to-quot-an-unexpected-error-has-occurred-quot-in-wss-v3.aspx minimal.masterを使用することができますが、私は誰もあなたにもっと情報なしで答えを与えることはできないと思います。 –

+0

あなたのminimal.masterが実際には/ _catalogs/masterpageフォルダ内にあることをKitが言って、確かめてください。/_catalogsはルートサイトに移動するので、/ sites/mysite /の下にいるときは機能しません。 –

+0

エラーメッセージがスローされた状態で質問を更新しました。 – Alice

答えて

2

を打っています意味すべきです。

最小限のマスターページにはこれらを持って:

<asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server"/> 
<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server"/> 
<asp:ContentPlaceHolder ID="SPNavigation" runat="server"> 
<asp:ContentPlaceHolder id="PlaceHolderHelpButton" runat="server"> 
<asp:ContentPlaceHolder id="PlaceHolderWelcomeMenu" runat="server"> 
<asp:ContentPlaceHolder id="PlaceHolderDeveloperDashboardLauncher" runat="server"> 
<asp:ContentPlaceHolder id="PlaceHolderSiteName" runat="server"> 
<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server" /> 
<asp:ContentPlaceHolder id="PlaceHolderPageSubTitle" runat="server" /> 
<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server" /> 
<asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" /> 
<asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server" /> 
<asp:ContentPlaceHolder id="PlaceHolderNavSpacer" runat="server" /> 
<asp:ContentPlaceHolder id="PlaceHolderBodyLeftBorder" runat="server" /> 
<asp:ContentPlaceHolder id="PlaceHolderPageImage" runat="server" /> 
<asp:ContentPlaceHolder id="PlaceHolderTitleLeftBorder" runat="server" /> 
<asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server" /> 
<asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat="server" /> 
<asp:ContentPlaceHolder id="PlaceHolderTitleAreaSeparator" runat="server" /> 

(マスターページにそれを追加しない限り)のでPlaceHolderMain2が動作しません

+1

@djeg私の悪いコンテンツコントロールはPlaceHolderMain(あなたが指定したリストにあります)と言うべきです。私はまだしかし、エラーを取得しています。 – Alice

関連する問題