SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

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

Hello I created a application page in visual studio 2010. Now i want to mapp this to our master page. the default master page is, applicationv4.master. Now to map this to our application page? I changed in the application page for the dynamicmasterpagefile attribute in the Page directive as DynamicMasterPageFile = "~/_layouts/application.master" . After deploying the solution i am getting following error. enter image description here

How to avoid this. I searched a lot, but didn't find solution.

share|improve this question
up vote 1 down vote accepted

I found the soulution for my problem. Following is the final markup.

<%@ Page Language="C#" DynamicMasterPageFile="~masterurl/default.master" Inherits="AppPages.Layouts.AppPages.ApplicationPage1"   EnableViewState="false" EnableViewStateMac="false"    %> 

Removed codebehind file, and added enableviewstate and enableviewstatemac attributes. Just copied from the viewlists.aspx page page directive

share|improve this answer
If you solved the problem stated in your original question, you should mark this answer as accepted answer to help future visitors. – Benny Skogberg Apr 3 '14 at 6:28

Can you try to update MasterPageFile property to new masterpage. This works perfectly fine in one of my application pages.<%@ Page language="C#" MasterPageFile="~/_layouts/MCPT/Collaboration.Master" Inherits="Collaboration.Tool.ApplicationPages.ChangePassword" EnableViewState="true" EnableViewStateMac="true"%>

share|improve this answer
@Nadeem.. need to change any thing in the tag provided by you? When I copy paste the same thing the error is still showing. – Mihir Sep 6 '12 at 13:26
@Mihir, you need to specify MasterPageFile attribute instead of DynamicMasterPageFile atrribute. Also, make sure you are specifying the proper path. – Nadeem Yousuf Sep 6 '12 at 13:37

Late Answer....What worked for me is this

Just replace DynamicMasterPageFile="~masterurl/default.master" with MasterPageFile="../ttl.master"

Where ttl.master is the master page you want to use

See Below

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="xxxxx.aspx.cs" Inherits="TSharePointProject.Layouts.TSharePointProject.xxxxx" MasterPageFile="../ttl.master" %>
share|improve this answer

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.