Search:
Namespaces
Discussions
.NET v1.1
Feedback
Getting to a root's root...
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspngconfig' list
.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Tim Royal
-- Moved from [aspngstart] to [aspngconfig] by Marcie Jones <
Click here to reveal e-mail address
> --
hi.
I've got a web application for my main web site. No problem yet. I need to
have a specific area (folder) set up for limited access, and thought I'd use
the handy dandy built in forms authentication for that directory in the
web.config.
I set up a virtual directory in IIS for it, then set up the web.config. The
*problem* I'm having is that all my pages use common header and footers, and
those are located in the main web app, not in the web app for the given
directory.
I'm not sure of the best way to get TO those common .ascx files now. WHereas
"~/Common/footer.ascx" worked fine without the virtual directory, now it
doesn't resolve the path. I don't really want to have duplicates of these
files, one for inside the secure web app area and one for the main web. I
also dont want to hardcode the paths because I'd have to change them between
the dev, staging, and live servers.
Any ideas appreciated.
Tim
Reply to this message...
Kloberg Mac (LAM) (VIP)
Ran into this a couple of times too. Here are some options that come to
mind:
1. Use this trick to pass application boundries: The old "include" tag still
works.
2. If the height of the header and footer doesn't change, you can use an
IFRAME to make it look like as if they where part of the page.
3. Instead of user controls, make the header and footer custom server
controls. Put them in the GAC and that way, you can use them all over the
place...
hth
--
Sincerely,
Mac Kloberg
LIEBHERR AMERICA INC.
http://www.liebherr-us.com
[Original message clipped]
Reply to this message...
Tim Royal
thanks for the tips. at least i wasn't the only one whose run across this.
i like the third option best. one, it supports netscape 4. two, it doesn't
require I go back to include files after all the touting I've done about how
.net is so cool and how it removes those old archaic include files. three,
it's just cooler.
thanks!
tim
->-----Original Message-----
->From: Kloberg Mac (LAM) [mailto:
Click here to reveal e-mail address
]
->Sent: Friday, July 19, 2002 6:04 PM
->To: aspngconfig
->Subject: [aspngconfig] RE: Getting to a root's root...
->
->
->Ran into this a couple of times too. Here are some options
->that come to
->mind:
->1. Use this trick to pass application boundries: The old
->"include" tag still
->works.
->2. If the height of the header and footer doesn't change, you
->can use an
->IFRAME to make it look like as if they where part of the page.
->3. Instead of user controls, make the header and footer custom server
->controls. Put them in the GAC and that way, you can use them
->all over the
->place...
->
->hth
->--
->Sincerely,
->Mac Kloberg
->LIEBHERR AMERICA INC.
->
http://www.liebherr-us.com
->
->
->> -----Original Message-----
->> From: Tim Royal [mailto:
Click here to reveal e-mail address
]
->> Sent: Friday, July 19, 2002 4:36 PM
->> To: aspngconfig
->> Subject: [aspngconfig] Getting to a root's root...
->>
->>
->> -- Moved from [aspngstart] to [aspngconfig] by Marcie Jones
->> <
Click here to reveal e-mail address
> --
->>
->> hi.
->>
->> I've got a web application for my main web site. No problem
->> yet. I need to
->> have a specific area (folder) set up for limited access, and
->> thought I'd use
->> the handy dandy built in forms authentication for that
->> directory in the
->> web.config.
->>
->> I set up a virtual directory in IIS for it, then set up the
->> web.config. The
->> *problem* I'm having is that all my pages use common header
->> and footers, and
->> those are located in the main web app, not in the web app for
->> the given
->> directory.
->>
->> I'm not sure of the best way to get TO those common .ascx
->> files now. WHereas
->> "~/Common/footer.ascx" worked fine without the virtual
->> directory, now it
->> doesn't resolve the path. I don't really want to have
->> duplicates of these
->> files, one for inside the secure web app area and one for the
->> main web. I
->> also dont want to hardcode the paths because I'd have to
->> change them between
->> the dev, staging, and live servers.
->>
->> Any ideas appreciated.
->>
->> Tim
->>
->> | [aspngconfig] member
Click here to reveal e-mail address
= YOUR ID
->> |
http://www.asplists.com/asplists/aspngconfig.asp
= JOIN/QUIT
->> |
http://www.asplists.com/search
= SEARCH Archives
->>
->
->| [aspngconfig] member
Click here to reveal e-mail address
= YOUR ID
->|
http://www.asplists.com/asplists/aspngconfig.asp
= JOIN/QUIT
->|
http://www.asplists.com/search
= SEARCH Archives
->
->
->
Reply to this message...
Strauss, Jon (VIP)
Another approach is for each of your two app directories to have a sub-virtual directory that points to one common virtual directory. The common virtual directory would contain your common (ascx) files. Then you could always reference the files the same way, regardless of application. Something like this...
/IncludeDir #store ascx and js file here
/App1/IncludeDir #points to /IncludeDir
/App2/IncludeDir #points to /IncludeDir
Then you can reference them in your code as "IncludeDir/MyHeader.ascx" regardless of which app you're in.
Steve Smith has an article that explains this at:
http://www.aspalliance.com/stevesmith/articles/netreuse1.asp
Hope that helps,
Jon
[Original message clipped]
Reply to this message...
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com