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

How to attach a default master page to a aspx site page ?

$
0
0

Hi

I make a aspx file in the sharepoint designer 2013, and I place a hyperlink inside the form.

It do well

Then I try to attach a master page.

In the sharepoint designer menu I click at the style button, then click at the attach button and select
the default master page "oslo"

But when I open the site in the internet browser, the site comes with an error.

Below here is the code before and after attaching the master page

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ Page Language="C#" %>
<%@ Register tagprefix="SharePoint" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
<meta name="WebPartPageExpansion" content="full" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 2</title>
<meta http-equiv="X-UA-Compatible" content="IE=10" />
<SharePoint:CssRegistration Name="default" runat="server"/>
</head>

<body>

<form id="form1" runat="server">
<asp:HyperLink runat="server" id="HyperLink1">HyperLink</asp:HyperLink>

</form>

</body>

</html>

%@ Page Language="C#" masterpagefile="~masterurl/custom.master" title="Untitled 2" 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" %>
<asp:Content id="Content1" runat="Server" contentplaceholderid="PlaceHolderUtilityContent">

<form id="form1" runat="server">
<asp:HyperLink runat="server" id="HyperLink1">HyperLink</asp:HyperLink>

</form>

</asp:Content>



Viewing all articles
Browse latest Browse all 7589

Trending Articles



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