visual studio 2010 - How to use MasterPage for WebPage in SubDirectory? -
parser error or master page error?
i have website masterpage in visual studio 2010 project.
i have many webforms located in subdirectories, question focus on subdirectory called /contact.
in vs2010, of webforms in /contact directory display supposed using page directive code:
<%@ masterpagefile="~/site.master" ... %>
it understanding ~/
supposed direct page root folder.
yet, when go page in folder, parser error saying masterpage not exist because page attempting load masterpage here:
'/contact/site.master'
if modify vs2010 project page directive tries step root level, vs project give me master page errors.
does not work:
<%@ masterpagefile="../~/site.master" ... %>
also not work:
<%@ masterpagefile="~/../site.master" ... %>
what trick here?
something wrong in visualstdio @ end.
i pretty sure doing correct.
i tried creating asp.net project, added folder called contact , dragged default.aspx page inside it
this code in markup file
<%@ page title="home page" language="c#" masterpagefile="~/site.master" autoeventwireup="true" codefile="default.aspx.cs" inherits="_default" %>
here folder structure.
every things works @ end.
btw if indeed trying read masterpage page in contact folder , framework somehow looks inside contact root try
../site.master
Comments
Post a Comment