Solved

Problem in MasterPage directives...

Posted on 2010-08-31
8
498 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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 500 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

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

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

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses

615 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