473,387 Members | 1,303 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,387 software developers and data experts.

Tilde for relative path

Where all can I use the ~ to represent the root?

I have a dir struct like so

-root
|----images
|
|----dirA
| |---file1.aspx
|----dirB
header.ascx
home.aspx

all pages get a header and footer control that are in the root.
These have images and take them from and images folder off the root. Also
hyperlink controls are used to build a dynamic menu.
When in a subdir like dirA or dir B, I was adding them with refrences like
.../home.aspx (in the header control). This worked fine here but on the host
provider gave a .. (cannot reference past top directory) or something liike
that.)

Should I have used a ~ instead? Don't know why it works here and not
there....

thanks,

Shane
Nov 17 '05 #1
3 2645
I think you can use the tilde only when working with server controls. When
ASP.NET renders the page it will replace it with the proper relative path.

Greg
"SStory" <Th*******@TAKETHISSPAMBUSTEROUT.Softhome.net> wrote in message
news:On**************@TK2MSFTNGP12.phx.gbl...
Where all can I use the ~ to represent the root?

I have a dir struct like so

-root
|----images
|
|----dirA
| |---file1.aspx
|----dirB
header.ascx
home.aspx

all pages get a header and footer control that are in the root.
These have images and take them from and images folder off the root. Also
hyperlink controls are used to build a dynamic menu.
When in a subdir like dirA or dir B, I was adding them with refrences like
../home.aspx (in the header control). This worked fine here but on the host provider gave a .. (cannot reference past top directory) or something liike that.)

Should I have used a ~ instead? Don't know why it works here and not
there....

thanks,

Shane

Nov 17 '05 #2
Well, I discovered the following.
If you use an ASCX file that dynamically builds hyperlinks and it is
included on a page in a subfolder, the links cannot be ../something on some
host providers but seem to work for ~/something.

Shane

"SStory" <Th*******@TAKETHISSPAMBUSTEROUT.Softhome.net> wrote in message
news:On**************@TK2MSFTNGP12.phx.gbl...
Where all can I use the ~ to represent the root?

I have a dir struct like so

-root
|----images
|
|----dirA
| |---file1.aspx
|----dirB
header.ascx
home.aspx

all pages get a header and footer control that are in the root.
These have images and take them from and images folder off the root. Also
hyperlink controls are used to build a dynamic menu.
When in a subdir like dirA or dir B, I was adding them with refrences like
../home.aspx (in the header control). This worked fine here but on the host provider gave a .. (cannot reference past top directory) or something liike that.)

Should I have used a ~ instead? Don't know why it works here and not
there....

thanks,

Shane

Nov 17 '05 #3
Well, I discovered the following.
If you use an ASCX file that dynamically builds hyperlinks and it is
included on a page in a subfolder, the links cannot be ../something on some
host providers but seem to work for ~/something.

Shane

"SStory" <Th*******@TAKETHISSPAMBUSTEROUT.Softhome.net> wrote in message
news:On**************@TK2MSFTNGP12.phx.gbl...
Where all can I use the ~ to represent the root?

I have a dir struct like so

-root
|----images
|
|----dirA
| |---file1.aspx
|----dirB
header.ascx
home.aspx

all pages get a header and footer control that are in the root.
These have images and take them from and images folder off the root. Also
hyperlink controls are used to build a dynamic menu.
When in a subdir like dirA or dir B, I was adding them with refrences like
../home.aspx (in the header control). This worked fine here but on the host provider gave a .. (cannot reference past top directory) or something liike that.)

Should I have used a ~ instead? Don't know why it works here and not
there....

thanks,

Shane

Nov 17 '05 #4

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

Similar topics

0
by: CHristian Niss | last post by:
hi there, in a lot of user controls we are using "~" in server tags to reference objects like images <img src="~/images/something.gif" runat="server" />. with framework 1.0 the tilde got...
6
by: openleren | last post by:
Hi all, how can I use a relative path in my web.config file for an Access db?: Instead of using <configuration> <appSettings> <add key="conAccess" value="microsoft.jet.oledb.4.0;data...
10
by: Shawn | last post by:
Hi, For a few years, I have been developing each of my clients websites using a seperate web site (unique IP) to solve problems with relative URL's between my local dev station and the...
9
by: Jared Tullis | last post by:
We have an .NET 1.1 application running on 4 2K3 load balanced servers (using WLBS). IIS has the .NET aspnet_isapi.dll mapped as a wildcard application map. The web.config points *.html to a...
10
by: PJ6 | last post by:
In the VB runtime I can specify paths from the base directory with ~ like so- Page.LoadControl("~\Controls\SomeControl.ascx") but when rendering the LINK tag HTML at runtime, this doesn't work...
4
by: ibiza | last post by:
Hi all, I have a problem which I don't understand with the "~" mark in a NavigateUrl property of an asp:HyperLink. I have this in a master page, to build the standard menu (rMenuItems is a...
8
by: JJ | last post by:
I'm confused about paths. I have a functionn that uses the mappath method, which I think requires a virtual path (is that the same as a relative path?). But this doesn't always work as the...
15
by: Lars Eighner | last post by:
Aside from the deaths of a few extra electrons to spell out the whole root relative path, is there any down side? It seems to me that theoretically it shouldn't make any difference, and it would...
4
by: Harsh Trivedi | last post by:
Hi, We have implemented URL rewriting in our site. It all went OK till home page links. When we click on home page category control, where we have implemented rewriting, it works ok, and open...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.