Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SiteMaster and web.config
Message
 
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01606317
Message ID:
01606366
Views:
29
>>>>Never mind
>>>
>>>I assume this is associated with the 'Specifying location of SiteMaster' post. :-}
>>>
>>>IAC, if you want to keep the SiteMaster page identical in both sites I was going to suggest using 'Add Existing Item' using the 'Add as Link' option.
>>>That will ensure that any changes are reflected in both sites.
>>
>>I replied to your message a few minutes ago but all what I typed (the entire paragraph) is gone now. Strange.
>>
>>Anyway,
>>You are correct that my issue has to do with the Site.Master. Here is the latest thing that I am trying to resolve:
>>1. Changed the location of the MasterPageFile in the child project (running in the virtual application) from ~/Site.Master to /Site.Master (since tilde refers to the root of the site).
>>2. The parent site (running in the root folder) does not have Site.Master. And the parent site runs under Forms Authentication
>>3. I changed the web.config of the child site to run under Anonymous Authentication.
>>
>>So now when I try to open a page from the child application (e.g. MyChildPage.aspx) as follows:
>>
>>mycomputername/MyMainApp/MyChildApp/MyChildPage.aspx
>>
>>
>>I get error:
>>
>>The virtual path '/Site.Master' maps to another application, which is not allowed.
>>
>>Source error points to this:
>>
>>@ Page Title="User Login" Language="C#" MasterPageFile="/Site.Master"
>>
>>
>>Please let me know if you see what I am missing. Thank you.
>>
>>UPDATE. I found the problem (can't explain it though). When I changed the location of MasterPageFile from
>>
>>MasterPageFile="/Site.Master"
>>
>>to
>>
>>MasterPageFile="./Site.Master"
>>(just added a period before the first slash)
>>
>>
>>I no longer get error. On to the next test.
>
>Glad you got it working (but I'm not sure why that made a difference either).
>
>Looking at this it seems as if a good solution is to:
>(a) put your sitemaster files in a folder outside the IIS structure.
>(b) Create a virtual directory (for e.g. named 'Masters') in the root of your website pointing to the physical folder above.
>(c) Change the aspx page MasterPageFile attribute to '~/Masters/Site.Master"
>

I saw this approach somewhere (placing Site.Master in a folder MasterPages). So far I dismissed it (seemed like overkill for my project). But I reserve the right to change my mind :)

>That allows you to use the same Site.Master in multiple sites.
>Note : Depending on the project type you may, in Site.Master, need to change the CodeBehind Attribute to CodeFile

I will check out the CodeBehind attribute to see if this is what I need to change.

I added to my message later - probably after you replied to my message - that there is a way to specify location of Site.Master at application level in web.config. So I am considering this approach too.

Thank you.
"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
Previous
Reply
Map
View

Click here to load this message in the networking platform