Solved

Problem in MasterPage directives...

Posted on 2010-08-31
8
482 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
  • 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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