1

I've created a master page that inherit from WebPartPage. This page would replace the newform on a custom list.

When i browse the page i've the error:

The file '/_layouts/15/wsp.generateDocFromMetalist/~masterurl/default.master' does not exist.

Do you know how to solve this issue? (My application page is deployed under /layouts/wsp.feature/

Here is my aspx

    <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#"  CodeBehind="newDOPForm.aspx.cs" Inherits="wsp.GenerateDocFromMetaList.Layouts.wsp.GenerateDocFromMetaList.newDOPForm" MasterPageFile="~masterurl/default.master" %>

<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">
    <SharePoint:ListFormPageTitle runat="server"/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">
    <span class="die">
        <SharePoint:ListProperty Property="LinkTitle" runat="server" id="ID_LinkTitle"/>
    </span>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageImage" runat="server">
    <img src="/_layouts/15/images/blank.gif?rev=23" width='1' height='1' alt="" />
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
<SharePoint:UIVersionedContent UIVersion="4" runat="server">
    <ContentTemplate>
    <div style="padding-left:5px">
    </ContentTemplate>
</SharePoint:UIVersionedContent>
    <h1>..:: I Like SharePoint ::..</h1>
    <table class="ms-core-tableNoSpace" id="onetIDListForm">
     <tr>
      <td>
     <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main"><ZoneTemplate>
        </ZoneTemplate></WebPartPages:WebPartZone>
      </td>
     </tr>
    </table>
<SharePoint:UIVersionedContent UIVersion="4" runat="server">
    <ContentTemplate>
    </div>
    </ContentTemplate>
</SharePoint:UIVersionedContent>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">
    <SharePoint:DelegateControl runat="server" ControlId="FormCustomRedirectControl" AllowMultipleControls="true"/>
    <SharePoint:UIVersionedContent UIVersion="4" runat="server"><ContentTemplate>
        <SharePoint:CssRegistration Name="forms.css" runat="server"/>
    </ContentTemplate></SharePoint:UIVersionedContent>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderTitleLeftBorder" runat="server">
<table cellpadding="0" height="100%" width="100%" cellspacing="0">
 <tr><td class="ms-areaseparatorleft"><img src="/_layouts/15/images/blank.gif?rev=23" width='1' height='1' alt="" /></td></tr>
</table>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderTitleAreaClass" runat="server">
<script type="text/javascript" id="onetidPageTitleAreaFrameScript">
    if (document.getElementById("onetidPageTitleAreaFrame") != null) {
        document.getElementById("onetidPageTitleAreaFrame").className = "ms-areaseparator";
    }
</script>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderBodyAreaClass" runat="server">
<SharePoint:StyleBlock runat="server">
.ms-bodyareaframe {
    padding: 8px;
    border: none;
}
</SharePoint:StyleBlock>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderBodyLeftBorder" runat="server">
<div class='ms-areaseparatorleft'><img src="/_layouts/15/images/blank.gif?rev=23" width='8' height='100%' alt="" /></div>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderTitleRightMargin" runat="server">
<div class='ms-areaseparatorright'><img src="/_layouts/15/images/blank.gif?rev=23" width='8' height='100%' alt="" /></div>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderBodyRightMargin" runat="server">
<div class='ms-areaseparatorright'><img src="/_layouts/15/images/blank.gif?rev=23" width='8' height='100%' alt="" /></div>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderTitleAreaSeparator" runat="server"/>

Thanks for your help

1

Use DynamicMasterPageFile instead of MasterPageFile:

<%@ Page Language="C#"  CodeBehind="newDOPForm.aspx.cs" Inherits="wsp.GenerateDocFromMetaList.Layouts.wsp.GenerateDocFromMetaList.newDOPForm" DynamicMasterPageFile="~masterurl/default.master" %>
  • i've tried this and have error: Error parsing attribute 'dynamicmasterpagefile': Type 'wsp.GenerateDocFromMetaList.Layouts.wsp.GenerateDocFromMetaList.newDOPForm' does not have a public property named 'dynamicmasterpagefile'. My application page inherit from WebPartPage – user1898765 Aug 15 '15 at 11:29
  • Inheriting from WebPartPage is a strange thing for an applicative (_layouts) page... Why don't you inherit from LayoutsPageBase? – Evariste Aug 15 '15 at 11:43
  • Because this page will be use form a list form. so in tutorial they explain that we've to inherit from WebPartPage. ilikesharepoint.de/2013/11/… – user1898765 Aug 15 '15 at 12:21
  • i've tried with v4.master in place of default.master as i'm in SharePoint 2013 but still have error – user1898765 Aug 15 '15 at 17:57
  • List form or not, an applicative page inherits from LayoutsPageBase (or UnsecuredLayoutsPageBase). You definitely can you an applicative page as a New/Display/Edit form. – Evariste Aug 15 '15 at 18:12
0

I use this in aspx and the error disappeared

MasterPageFile="~/_layouts/default.master"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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