Suppose this scenario. On my Default.aspx
, I insert a context (WebForms), called MyContext.ascx
, that load an image. So the path would be :
<img src="/images/hello.gif" />
Well. Now, I'd like to insert the same context on another .aspx page, that is in another forlder, such as /myfolder/MyPage.aspx
Than, the path of the image now should be :
<img src="../images/hello.gif" />
How you can see, I can't manage two different path for the same context. So, is there a way (symbol) to call the virtual-path
of my application? Without using my own function as
<img src="<%=MyUtilities.GiveVirtualPath%>/images/hello.gif" />
which is boring. Who know?