Solved

Problem in MasterPage directives...

Posted on 2010-08-31
8
473 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
 
LVL 8

Author Comment

by:PagodNaUtak
ID: 33565829
yes...
 
0
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.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
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 Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now