Solved

Problem in MasterPage directives...

Posted on 2010-08-31
8
456 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
Comment Utility
can you post your ASPX for the page
0
 
LVL 8

Author Comment

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

Expert Comment

by:puru1981
Comment Utility
is this path exist in your folder structure
/12/Template/Layouts
0
 
LVL 8

Author Comment

by:PagodNaUtak
Comment Utility
yes...
 
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 8

Author Comment

by:PagodNaUtak
Comment Utility
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
Comment Utility
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
Comment Utility
try to remove the ~ sign from the masterpage path
0
 
LVL 8

Author Closing Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Microsoft SharePoint Foundation 2010 and Microsoft SharePoint Server 2010 do not offer the option to configure the location of the SharePoint diagnostic trace log files during installation.  This can, however, be configured through Central Administr…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

15 Experts available now in Live!

Get 1:1 Help Now