2

I am learning sharepoint designer, and one of the things i have been trying to do today is to create a custom page! I want to use an existing master page to create it, but every time I Attach the Master page the whole file changes to this:

<%@ Page Language="C#" masterpagefile="~masterurl/default.master" title="Untitled 1" inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" meta:webpartpageexpansion="full" meta:progid="SharePoint.WebPartPage.Document" %>

<%@ Register tagprefix="SharePoint" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

Then I am lost, for example, how can i add a div or a webpart to the page??

3 Answers 3

1

is that all you have? For example, a random page of my app looks like this:

    <%@ Page language="C#" MasterPageFile="~masterurl/default.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, 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="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">
    <%--<SharePoint:ScriptLink name="sp.js" runat="server" OnDemand="true" LoadAfterUI="true" Localizable="false" />--%>
    <script type="text/javascript" src="../Scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="../_layouts/15/sp.runtime.js"></script>
    <script type="text/javascript" src="../_layouts/15/sp.js"></script>
    <link rel="Stylesheet" type="text/css" href="../Content/App.css" />

    <script type="text/javascript" src="../Scripts/scriptconfigpage.js"></script>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server">
    TitleText
</asp:Content>

<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
    <WebPartPages:WebPartZone runat="server" FrameType="Default" ID="full" Title="loc:full" />
    <h2>HeaderText</h2><br />
    <button type="button" onclick="jsGoToPermissionPage2(); return false;">App Permission</button>
    <br />

</asp:Content>

When you place HTML in the PlaceHolderMain for example then this content appears in the body of the page.

1
  • After I create my aspx page and attach the master page, all there is left is these two lines above. Everything else is gone....... Commented Apr 22, 2015 at 6:47
1

After you create the content page, you can locate the content placeholder to which you want to add custom content. The Master Page toolbar makes it easier to locate the content placeholders.

  • On the View menu, click Toolbars, and then click Master Page.
  • On the Master Page toolbar, click the arrow next to the Regions box, and then click the placeholder to which you want to add custom content.
  • After you locate the content placeholder, you can add custom content to it.
  • Click the content placeholder, click the arrow Button image in the upper-right corner to show the Common Content Tasks list, and then click Create Custom Content.
  • For example, if you are adding content to PlaceHolderMain, the main content region for the new content page is now editable. Note the word (Custom) (in parentheses) on the content placeholder tab. This lets you know that the content is custom content for this page only, and that it is not retrieved from the attached master page.
  • The content region becomes editable, as can be seen by the text (Custom) beside the content placeholder.

You can now add custom content to the page. You can, for example, add custom views, forms, Web Parts, and Web Part Zones.

1
  • On the View menu, there are no Toolbars, only Task Panes.. Commented Apr 22, 2015 at 6:56
1

if you convert your own Html Page to Master Page then the default ribbon hide and you lost on your page. then go to that URL to change the master page

http://yoursitename/_layouts/15/ChangeSiteMasterPage.aspx

Please visit this URL, it may help you lot.

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.