This project is read-only.

Pathing of styles/images in module

Topics: Writing modules
May 5, 2011 at 12:57 AM
Edited May 5, 2011 at 12:58 AM

I put the style sheets specific to my module under the /Styles folder in my module and I've created a ResourceManifest.cs file and the corresponding Style.Require entry in my view.

The images that the style sheet is calling are in my module folder under /Content/Images. The images are references in my style sheet using '../Content/Images/image.jpg' which renders to /Modules/MyModule/Content/Images/image.jpg. I even tried referencing the path as '/Modules/MyModule/Content/Images/image.jpg'.

The images will not appear though...I'm looking at the path and it's completely correct. I looked at the FollowMe module and images in that module are being path'd in the same manner. Is there something I'm missing? I verified the image is definitely in this folder...shouldn't I be able to reference an image in my Module folder?

May 5, 2011 at 1:02 AM

Quick guess: do you have a web.config in those folders that enables the serving of these files?

May 5, 2011 at 1:09 AM

You are the man...that was exactly it. I created those folders since they didn't exist and totally neglected to put a web.config in the Content folder. I copied the one over from my theme and it's working great now. Thanks for that...probably would have taken me hours to realize I was missing that file.