Contents
Is the image URL relative to the master page?
The ImageUrl property contains a relative URL. If the Master Page is located in a folder named MasterPages, then the URL is interpreted like this: Even if a content page is located in a completely different folder, the ImageUrl is interpreted relative to the folder that contains the Master Page and not relative to the content page.
There are 2 ways you can insert an image in a SharePoint master page. Both of them are relative url. 14 Hive (Physically hosted): You can place your images physically in the 14 hive folder under C:\\Program Files\\Common Files\\Microsoft Shared\\Web Server Extensions\\14\\TEMPLATE\\IMAGES
How to use relative URL for image in SharePoint Designer?
Thereby you can alwas reach it by just using the relative URL: ~site – Web site (SPWeb) relative link. ~sitecollection – site collection (SPSite) relative link. Agree with Robert that you would probably want to deploy it to the layouts folder.
Where to put images on a master page?
Assume you have a master page created in a subfolder called Master and images in a subfolder called Images under Master folder in your solution. Since master pages are created to provide consistent look across your website, it is the right place to put your logo and your website navigation system.
How are relative URLs interpreted in ASP.NET?
If an HTML element such as an or tag includes a relative URL, the relative URL is interpreted relative to the content page. For example, suppose you add the following tag to a Master Page: The src attribute contains a relative URL.
How to determine the absolute URL of an image?
To remedy the broken image shown in Figure 2, we need to update the element’s src attribute so that it uses an absolute URL instead of a relative one. To determine the correct absolute URL, visit one of the web pages in your website and examine the Address bar.