Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

SharePoint 2013 - Missing Publishing Page Ribbon/Tab on custom page layout - Page language="C#" Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,.... VS CodeBehind="BlogDemo.aspx.cs" Inherits="DemoProject.Branding.BlogDemo"

$
0
0

I created page layouts using Visual Studio 2013 and SharePoint 2013. I added both ASP.NET web controls (e.g. asp:Label, asp:HyperLink) and SharePoint web controls (e.g. SharePointWebControls:UrlField) in a page layout.

However, when I deployed the solution, I cannot edit all the ASP.NET & SharePoint web controls (column fields from custom content type used for the page layout) except the web part zones.

Then I found out about inherits property:

1) if I use the code for the page layout as shown below:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BlogDemo.aspx.cs"Inherits="DemoProject.Branding.BlogDemo" MasterPageFile="/_catalogs/masterpage/DemoProject/DemoMasterPage.master"%>

Result: There is no publishing ribbon/tab. E.g. Edit, Publish..... although both ASP.NET & SharePoint web controls can be displayed on the page layout.

Screenshot:

2) if I use the code instead as shown below:

<%@ Page language="C#" Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,Microsoft.SharePoint.Publishing,Version=15.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c"meta:progid="SharePoint.WebPartPage.Document" %>

Result: Publishing ribbon/tab is available, but ASP.NET web controls won't appear. Only SharePoint web controls appear on the page layout.

Screenshot:

I wonder how I can combine both codes to ensure that the page layout can have publishing ribbon/tab and displays both ASP.NET & SharePoint web controls.





Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>