In another thread I wrote that, when placing pages of the project in a virtual application and in sub-folder of the site, I came across a problem where specifying location of Site.Master as follows didn't work:
@ Page Title="User Login" Language="C#" MasterPageFile="~/Site.Master"
The tilde (~) in front of the Site.Master was pointing to the root of the site (where there is no Site.Master file).
Changing the location to the following (in a test page) works:
@ Page Title="User Login" Language="C#" MasterPageFile="./Site.Master"
That is, placing a period in front of the slash resolved the issue.
Now before I go through all pages of the project and change the tilde to a period, I would like to ask. What if - in some case - I pace these pages not in the virtual application sub-folder to the site but in the root site itself? Will "./Site.Master" work for those case? That is, I want to be sure that I don't have to change this back and forth depending on where the pages will reside.
TIA.
UPDATE. I also found msdn page describing how the location of Site.Master can be set at the application level. This is done by specifying the location in web.config as follows:
<pages masterPageFile="MySite.Master" />
So I am considering this approach too. Let me know if you know a downside of this approach.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham