Problems with loading images in module

Topics: Troubleshooting
Feb 24, 2012 at 8:35 AM
Edited Feb 24, 2012 at 8:35 AM


I'm trying to insert a image in my module, but I'm having some problems.

<a href="#"> <img  src="@Href("~/Modules/Orchard.Slider/Content/img/other.jpg")"  /> </a>

In my view i wrote thibut the image is not loading, it says that resource is not found.
However, if I put my picture in Orchard.Users module folder, it is working:


<a href="#"> <img  src="@Href("~/Modules/Orchard.Users/Content/img/other.jpg")"  /> </a>


Does anyone know why this is happening? Is this a bug, or I'm missing something?

Just to add, that when I tried to build the same module for the first time, I loaded image from my folder normally (with the first line of code), but I couldn't include css file, as



didn't produce anything. It isn't the case that I had <link href='...> in my html source, with the 'resource not found thing' - there wasn't any line considering the inclusion of slider_style.css

Then I created same project again, and now I can include css, but can't load images. The thing is that i just copy/pasted the code, only change was that I
actually made a new Orchard module project and new .cs and cshtml. files.

Thanks in advance,

Feb 24, 2012 at 9:25 AM

I was missing web.config in my images folder, and now it's working. Still, I don't know how I managed to get it working without it before, and why Styles weren't loading.