We are creating an application page and do not want it to inherit the masterpage. Is this possible?
3 Answers
Remove master page reference from your site
-
What do you mean "Remove master page reference from your site first". Do you mean by going to Site Settings -->Site Master Page Settings? there you can choose different master pages. you cannot remove it.– MedesNov 8, 2016 at 14:01
You should have a line similar like this in your .aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CreateCollabWeb.aspx.cs" Inherits="Something.Layouts.CreateCollabWeb" DynamicMasterPageFile="~masterurl/default.master" %>
Here you can point to a different master page:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CreateCollabWeb.aspx.cs" Inherits="Something.Layouts.CreateCollabWeb" DynamicMasterPageFile="~masterurl/myCustomMaster.master" %
-
1OK, what if I want it to be an empty page with white background and text. No masterpage at all.– variableMar 24, 2014 at 12:26
-
1Then you would have to have a "blank" masterpage. You can also call your page with
?isDlg=1
to get rid of leftnav and parts of the header Mar 24, 2014 at 12:27 -
Is there any option, this is for purpose of creating a terms and conditions page. Any other idea?– variableMar 25, 2014 at 14:00
-
Remember that Application pages are just normal .aspx
pages, nothing SharePoint specific.
So you can just remove the DynamicMasterPageFile
property from the <%@ Page %>
tag.
Just remember to add html
, head
, body
now that a masterpage is no longer dictating the html structure.
-
-
-
-
@variable What does the ULS log say?– user2536Mar 26, 2014 at 8:08
-
I guess it needed somthing with runat=server; <form runat="server"> worked– variableMar 26, 2014 at 8:43