SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We are creating an application page and do not want it to inherit the masterpage. Is this possible?

share|improve this question
up vote 1 down vote accepted

Remove master page reference from your site first, than place this sample code to try it out




        <form runat="server">
    this the the policy page
    <br /><br />
<input onclick="close_window()" type="button" value="Close" />
    <asp:Button ID="Button1" runat="server" Text="Accept & Continue" OnClick="btnContinue_Click" />


share|improve this answer

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" %
share|improve this answer
OK, what if I want it to be an empty page with white background and text. No masterpage at all. – variable Mar 24 '14 at 12:26
Then 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 – Robert Lindgren Mar 24 '14 at 12:27
Is there any option, this is for purpose of creating a terms and conditions page. Any other idea? – variable Mar 25 '14 at 14:00
Those are your options – Robert Lindgren Mar 25 '14 at 14:32

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.

share|improve this answer
But I want to use the sharepoint object model in the code behind. – variable Mar 25 '14 at 5:31
page gives error – variable Mar 25 '14 at 6:06
I tried this but there is technical error when loading page – variable Mar 26 '14 at 6:58
@variable What does the ULS log say? – Daniel Ziga Mar 26 '14 at 8:08
I guess it needed somthing with runat=server; <form runat="server"> worked – variable Mar 26 '14 at 8:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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