I have had a look at this page
HTML – pick images of Root Folder from Sub-Folder
This page contains an example for HTML images.
I have created a web control that represents footer of all the website pages. Now some pages are directly in the root and some are in another folder. In the web control I have to fix the
So without switching between ../ or ./ how can I determine the root of the website and then say something like root/images/abcd.jpg in the web control?
If you make your
<img>tag a server control by addingrunat="server"you can simply do the following and it will always resolve the url correctly, regardless of where the user controls is referenced:The ResolveClientUrl method will automatically resolve the correct path starting off from the root of the app
(~/)