Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem in MasterPage directives...

Posted on 2010-08-31
8
Medium Priority
?
500 Views
Last Modified: 2012-06-21
Hi!

When I insert a MasterPage directives in my sharepoint custom page I receive the below error.
Any help?

Regards,

Joseph

The referenced file '/12/Template/Layouts/ApplicantManagement.Web/MasterPages/default.master' is not allowed on this page.   at System.Web.UI.TemplateParser.ProcessError(String message) 
   at System.Web.UI.BaseTemplateParser.GetReferencedType(VirtualPath virtualPath, Boolean allowNoCompile) 
   at System.Web.UI.PageParser.ProcessMainDirectiveAttribute(String deviceName, String name, String value, IDictionary parseData) 
   at System.Web.UI.TemplateParser.ProcessMainDirective(IDictionary mainDirective)

Open in new window

0
Comment
Question by:PagodNaUtak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 9

Expert Comment

by:puru1981
ID: 33565478
can you post your ASPX for the page
0
 
LVL 8

Author Comment

by:PagodNaUtak
ID: 33565699
Hi, Attached here is the ASPX File...
Default111.zip
0
 
LVL 9

Expert Comment

by:puru1981
ID: 33565810
is this path exist in your folder structure
/12/Template/Layouts
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 8

Author Comment

by:PagodNaUtak
ID: 33565829
yes...
 
0
 
LVL 8

Author Comment

by:PagodNaUtak
ID: 33565848
Yes, it exist in the folder structure, and in fact I just browse it...
0
 
LVL 9

Accepted Solution

by:
puru1981 earned 2000 total points
ID: 33565874
you need to do this like below:

protected override void OnPreInit(EventArgs e)
{
    base.OnPreInit(e);

    SPWeb Web = SPContext.Current.Web;
    string strUrl =
        Web.ServerRelativeUrl + "/_catalogs/masterpage/default.master";

    this.MasterPageFile = strUrl;
}


http://msdn.microsoft.com/en-us/library/cc297200.aspx
0
 
LVL 9

Expert Comment

by:puru1981
ID: 33565900
try to remove the ~ sign from the masterpage path
0
 
LVL 8

Author Closing Comment

by:PagodNaUtak
ID: 33566013
I been debugging the whole day, yet you found the answer rigth away... thanks...
0

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question