Thursday, March 22, 2012

VS 2005 web dev on localhost

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,
HowardWell, 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
"Howard" <howdy0909@.yahoo.com> wrote in message
news:O7x$nHjSGHA.4300@.TK2MSFTNGP14.phx.gbl...
>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
>
>
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/
"Anthony Merante" <amerante@.hotmail.com> wrote in message
news:e1gY80jSGHA.4600@.TK2MSFTNGP11.phx.gbl...
> 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
> "Howard" <howdy0909@.yahoo.com> wrote in message
> news:O7x$nHjSGHA.4300@.TK2MSFTNGP14.phx.gbl...
>
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.
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
"GregG" <GregG@.electron.com> wrote in message
news:0q1n12ladkklp6t5dku9ev3mlermndt2lt@.
4ax.com...
> Howard said:
>
> 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.
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.
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Howard" <howdy0909@.yahoo.com> wrote in message news:eOHSZrkSGHA.6084@.TK2MSFTNGP14.phx.gbl.
.
> 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
>
> "GregG" <GregG@.electron.com> wrote in message news:0q1n12ladkklp6t5dku9ev3
mlermndt2lt@.4ax.com...
>

0 comments:

Post a Comment