I am trying to use customer master page in my application page but getting following error:


The referenced file '/_catalogs/mycustompage.master' is not allowed on this page.


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SomeCode.aspx.cs" Inherits="SomeCode.Code" MasterPageFile="~/_catalogs/mycustompage.master" %>

How do I fix this issue?

1 Answer 1


I had to include the master page (.master) in the project and then reference the master file in the application page for it to work.

Add a Layouts scoped folder and add the master file to that folder. Make sure you actually add the master file to your project and reference from there.

enter image description here

  • But what about CSS, JS and images used in master page including any user controls? I manually copied master page in Layouts folder and now it is giving me error that some user control doesn't exist. If I use your method will it work? Sep 9, 2015 at 19:06
  • I'd recommend testing with a basic master page to see if it works or not and then build upon it.
    – Akhoy
    Sep 9, 2015 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.