Dan Lugg
Dan Lugg

Reputation: 20592

ASP.net master pages, web root, and directory structure

I've revised (but not changed) this question for brevity; see edits for previous version(s)

I have an ASP.net website (non-application, non-MVC) with the following (proposed) file system hierarchy:

Proposed directory structure

What configuration changes (if any) can be made to implement this scheme? Is this possible? I've received the error Cannot use a leading .. to exit above the top when having targeted /Site as the application. I'm wondering if there's a way around this.

As I see it, given the site runs in C:\www\SiteRoot\ at http://example.com/:

            PATH                        URL
~           C:\www\SiteRoot\            none
/           C:\www\SiteRoot\Site\       http://example.com/
~/Site      C:\www\SiteRoot\Site\       http://example.com/
/About      C:\www\SiteRoot\Site\About  http://example.com/About/

Therefore, MasterPageFile="~/Site/About.master" will still resolve correctly,
as will <img src="/About/ImageInAboutFolder.jpg" />. Hopefully this sort of configuration is possible.

Upvotes: 1

Views: 511

Answers (1)

podiluska
podiluska

Reputation: 51494

If I understand your question correctly, no, you can't.

Upvotes: 2

Related Questions