Problem in MasterPage directives...

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

LVL 8
PagodNaUtakAsked:
Who is Participating?
 
puru1981Connect With a Mentor Commented:
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
 
puru1981Commented:
can you post your ASPX for the page
0
 
PagodNaUtakAuthor Commented:
Hi, Attached here is the ASPX File...
Default111.zip
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
puru1981Commented:
is this path exist in your folder structure
/12/Template/Layouts
0
 
PagodNaUtakAuthor Commented:
yes...
 
0
 
PagodNaUtakAuthor Commented:
Yes, it exist in the folder structure, and in fact I just browse it...
0
 
puru1981Commented:
try to remove the ~ sign from the masterpage path
0
 
PagodNaUtakAuthor Commented:
I been debugging the whole day, yet you found the answer rigth away... thanks...
0
All Courses

From novice to tech pro — start learning today.