Root directory master page with sub-folder's child page

0

Can we use Master Page that is in the root directory for child pages those are in sub-folder? If yes then how? please let me know

I know its duplicate of this question Cannot use a leading ../ to exit above the top directory

but that is related to image file and i am getting error in master page's path that is not working here and I didn't get my answer there because I did this and got an error below

System.Web.HttpException (0x80004005): Cannot use a leading .. to exit above the top directory.

this is what I have tried

<%@ Page Title="" Language="C#" MasterPageFile="..\Main.Master" AutoEventWireup="true" CodeBehind="ChildPage.aspx.cs" Inherits="IMS.SubFolder.ChildPage" %> 

<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="ChildPage.aspx.cs" Inherits="IMS.ChildPage" %>

<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="ChildPage.aspx.cs" Inherits="IMS.SubFolder.ChildPage" %> 

<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="ChildPage.aspx.cs" Inherits="IMS.ChildPage" %>

<%@ Page Title="" Language="C#" MasterPageFile="../Main.Master" AutoEventWireup="true" CodeBehind="ChildPage.aspx.cs" Inherits="IMS.ChildPage" %> 
c#
asp.net
asked on Stack Overflow Nov 27, 2018 by Athar Sayed • edited Nov 27, 2018 by Athar Sayed

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0