Base URL in ASP.net Master Pages with virtual Directories

Posted by Ian on Stack Overflow See other posts from Stack Overflow or by Ian
Published on 2010-03-16T08:10:18Z Indexed on 2010/03/16 8:16 UTC
Read the original article Hit count: 612

Filed under:
|
|

Hi All,

I have an ASP.net master page. In this master, I have all my css and javascript files defined. I also have a few images and a few buttons and hyperlinks.

All the urls are all declared as relative ie "/scripts/ian.js"

Everything works fine if this site is the root website, but I need it to work in a virtual directory.

My problem is when I place this website in a virtual directory under a root site, all my links are pointing to the root site. so my links point to www.root.com/scripts/ian.js but it should be pointing to www.root.com/virtualDir/scripts/ian.js

I thought the Base Href tag in the header would help, but so far it does not seem to be helping in anyway. All the links are still pointing to the root website when i hover over them.

Any suggestions or ideas are welcome.

Thanks

© Stack Overflow or respective owner

Related posts about url

Related posts about ASP.NET