473,738 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5339
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*****@hotmai l.com> wrote in message
news:19******** *************** ******@40tude.n et...

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
2142
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: /usr/local/www/vhosts/publicpen.com/htdocs/index.htm For all the domains to share this software, I want to put the cms here:
13
14323
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 path within c:\Inetpub\wwwroot rather than the real path. Can anyone please tell me why this isn't working? Regards, John
3
7288
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 to have th function check to see where the file sits, then add the appropriat ../ infront of it. Unfortunatly I'm totally stumped as to what I need to do. A ex-co-worker of mine used to have a function similar to this, howeve we've lost...
4
7859
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 injected. If I specify a document-relative path (e.g., src="../someFolder/AnotherFolder/TheGraphic.gif"), then it works fine, but only for documents that exist at the level in the directory structure. I thought I could use a root-relative...
3
1569
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 to the application path as in ASP.NET so that links have the correct path relative to the web-site root." However, what do you do about ".css", ".js" links in your html? Dave.
19
10233
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 when I deploy to a remote test server running real IIS, the real root of my application becomes: http://localhost/ What I want to do is have it so that on my local machine the asp.net dev
4
7578
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. Thanks,
4
1880
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 different forum if I made a mistake. In any case, thank you for spending the time to read this loooong case and/or for your input. With that said, here's the background of the situation:
3
2261
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. localhost:7859/FolderName/filename_that_should_be_in_the_root.aspx this is a pain as I do my links from the root e.g. /css/site.css and the additional folder in the path stops that. Is there any way to get the site in debug mode to show
0
8968
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8787
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9473
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9259
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6750
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4824
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.