473,395 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to get path of root web site when app is two levels deep?


I have an asp.net app that is in a folder which is two levels under the
website root folder. The website has a login.aspx which is in the root
folder.

How do I get the relative path to the web site root folder (not the curent
app folder)? A generic one that works no matter how deep the folder is in
the folder heirarchy
--
John Dalberg
Nov 19 '05 #1
1 5327
If it's just a subdirectory, you can use a slash "/"
to signify the root directory of an application.

i.e., / refers to the root directory

If it's an ASP.NET application, you can't make a reference
to the root directory of another application, except by name
in a fully-qualified URL.

i.e., From http://yourserver.com/oneapp
you could refer to http://yourserver.com/anotherapp

but you can't refer to /anotherapp from /oneapp,
unless you use a fully-qualified URL

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"John Dalberg" <jo*****@hotmail.com> wrote in message
news:19*****************************@40tude.net...

I have an asp.net app that is in a folder which is two levels under the
website root folder. The website has a login.aspx which is in the root
folder.

How do I get the relative path to the web site root folder (not the curent
app folder)? A generic one that works no matter how deep the folder is in
the folder heirarchy
--
John Dalberg

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: lawrence | last post by:
I've a server with 50 domains in the vhosts folder. I want all 50 websites to run from a single copy of a PHP/MySql cms. Here is a typical path to the index.htm file of a site: ...
13
by: John Rebbeck | last post by:
I've got the directory f:\Company\Product set as web shared so it's got a virtual directory in the default web site on my test server's IIS. If I try to use Server.MapPath in that site it returns a...
3
by: b1azesk | last post by:
I'm trying to write a Javascript to set a relative path for my files, s I don't have to type in an absolute path. I know that I need to someho define the root directory, likely using /, then I need...
4
by: Win, Pats | last post by:
I have a snippet of HTML that I inject into a number of pages throughout my Web site at runtime. My problem is that I'm not getting the image to appear in all documents into which this snippet is...
3
by: Dave | last post by:
Hi, since I'm developing on XP and can only have on website, how can you refer to your root application (not web) in your paths? I read for server controls that "the ~/ prefix will be converted...
19
by: Steve Franks | last post by:
I am using VS.NET 2005 beta 2. When I run my project locally using the default ASP.NET Development Web Server it runs using a root address like this: http://localhost:11243/testsite/ However...
4
by: Tee | last post by:
Hi, Can anyone tell me how to get the path of IIS root folder from coding? Eg: C:\Inetpub\wwwroot. I would like to detect it via coding as not everyone set it at the default folder. ...
4
by: John Smith | last post by:
Hello, I'm not sure if these are the appropriate forums for my question since it is closer to about Visual Studio 2005 than it is about .NET framework. So please pardon me and direct me to a...
3
by: Chris | last post by:
When I go into debug mode and the web page I am working on opens in the browser via the local Cassini Web Server I get a path appended onto the full path e.g. ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.