0

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.

3 Answers 3

1

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

1
  • 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, 2014 at 6:28
0

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"%>

2
  • @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, 2012 at 13:26
  • @Mihir, you need to specify MasterPageFile attribute instead of DynamicMasterPageFile atrribute. Also, make sure you are specifying the proper path. Sep 6, 2012 at 13:37
0

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" %>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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