This project is read-only.

Module Image

Feb 3, 2011 at 6:47 PM

I am trying to load images inside a .cshtml file as follows:

<img src="@Href("~/Modules/Orchard.PublishLater/Content/Admin/images/scheduled.gif")" />
<img src="@Href("~/Modules/ProjectName.Module/Content/Admin/images/imageName.gif")" />


However, only the image "scheduled.gif" is displayed. I have made sure that the image "imageName.gif" exists and that the path is correct.. Is there any reason why I can't get this image to load? Do I need to register it somewhere?


Feb 3, 2011 at 6:50 PM

When you "view source" on the browser, what do you see?

Feb 3, 2011 at 8:50 PM

I had the same issue with a javascript, but for that i needed to alter the web.config with script;read accesspolicy.
Maybe for images it's also just altering your web.config. Check the Orchard.PublishLater web.config and monkey it.


Feb 3, 2011 at 10:33 PM

rfcdejong - Thanks for the suggestion. I haven't had problems with scripts but i will check the web.config file and see what I can find.


bertrandleroy - this is what I see when I view the source:


<img src="Modules/Orchard.PublishLater/Content/Admin/images/scheduled.gif" />
<img src="Modules/ProjectName.ModuleName/Content/Admin/images/imageName.gif" />

Feb 4, 2011 at 2:06 AM

Yeah web.config most likely to be responsible.

Feb 4, 2011 at 5:22 PM

Thank you guys. I was actually missing a web.config file in the content directory. Once I added it it work like a charm.