Base URL in ASP.net Master Pages with virtual Directories

前端 未结 5 697
既然无缘
既然无缘 2021-01-03 01:24

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 url

5条回答
  •  春和景丽
    2021-01-03 01:49

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

    Those seem to be absolute URL's that you're using, rather than relative URL's, which is probably why the tag isn't having the desired effect:

    This attribute specifies an absolute URI that acts as the base URI for resolving relative URIs.

    -- from http://www.w3.org/TR/html401/struct/links.html#h-12.4

    You could try removing the leading '/' from your URL's to see if that works?

    Failing that, I tend to use ResolveClientUrl to get around issues like this, which you'd use in the same way as others have suggested using ResolveUrl:

    
    ...
    " alt="..." />
    

    Hope this helps.

提交回复
热议问题