VS 2005 web dev on localhost

H

Howard

I develop my website locally with VS 2005. the problem is all the links are
broken because the directories don't match.
on my production server it's www.myname.com/
but on my local server it's localhost/myname/

it's there a way around this without having to manually change all the
links?

thanks,
Howard
 
A

Anthony Merante

Well, they should. As long as your links are relative, you shouldnt have to
do anything at all. I suspect that your links are pointing to your local
file system rather than a relative web path.

Can you show me an example of a link?

Tony
 
H

Howard

Not all links, only the link in a menu in my master page.
This is the html I used for the menu links
/blogs/
/audio/

THis is what gets used from the production server which is correct
www.myname.com/blogs/
www.myname.com/audio/

If i run the site on my localhost i get this
localhost/blogs/
localhost/audio/

it should be
localhost/myname/blogs/
localhost/myname/audio/
 
G

GregG

Howard said:
Not all links, only the link in a menu in my master page.
This is the html I used for the menu links
/blogs/
/audio/

Without getting into the particulars of hierarchical directory
structures, you should either leave off the leading slash, or use the
tilde. i.e.:

~/blogs/
~/audio/

That tells ASP.Net2 to resolve the hash to the root of the web
application.

Otherwise, stick with relative paths.
blogs/
audio/

What you are doing resolves to the root of the drive or wwwroot.

FWIW,


Greg G.
 
H

Howard

if i don't resolve it to the root of the web app the url of the menu item
will add to it self each time it's clicked.

the ~ only works if i set the <a> to runat=server
will there be any performance hit, i have a lot of links
 
J

Juan T. Llibre

re:
the ~ only works if i set the <a> to runat=server
will there be any performance hit, i have a lot of links

Not at all. You can set it, especially if it fixes your problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top