Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# MadShad 8/10/2006 8:52 AM
How do I reference the module images directly in a content page (not a template page)? I have tried everything to find the correct path, but to no avail!
 img runat=server src=[where am I?]/Images/nextpage.gif border=0 
# MadShad 8/10/2006 11:13 AM
Ok the path is '/mycms/Modules/mymodule/Images/my.gif'
But I really want to generate the prefix '/mycms/Modules/mymodule/' dynamically.

So I what I am asking now is where is this path accessable in the API?
# dagda1 8/11/2006 6:18 AM
Hi,

If it is a server image control then the following should work:

'~/Modules/mymodule/Images/my.gif'

Failing that

string url = ResolveUrl('~/Modules/mymodule/Images/my.gif');

~ will get you to the base of your site.
# MadShad 8/13/2006 5:19 AM
Thanks dagda1,

I knew the answer would be simple, but if you don't know where to look then it can take some time to get there.

It was exactly the '~' I was looking for.

Is this an ASP specific 'thing', or just for this project. I come from a JSP background, so it's all a question of syntax for me at the moment. :-)

Thanks again.