DotNetNuke Skinning – Dealing with Images
There is one final basic topic we need to address prior to moving on to the details of working with Skin Objects, and that is the topic of including images in our skins and containers.
You might think that because you know where the images are on your installation, you’ll know where the images are on any other installation. But aside from the fact that DotNetNuke can be installed in a subdirectory you know nothing about, what if they rename the skin or module directory?
Now, ideally, the images will be loaded by using CSS specifications. This is the most portable way of adding images into our skins in such a way that the images can be found consistently. If you can make that work, I suggest you use that method first.
However, it is not always possible to achieve the effect we are after unless we put the image in the HTML markup in our ASCX file.
No. We need some way of specifying the directory for the images at runtime. And we do this with the SkinPath property.
For example, let’s say that you want to include an image tag in either your skin file or your container file. You would use the following syntax:
<img src="<%=SkinPath%>image.gif" height="10" width="150" border="0">
Assuming that image.gif is in the same directory as the ASCX this statement is in, the image will be loaded properly at runtime regardless of where DotNetNuke is installed or what directory the skin or container is in.
Related articles
- DotNetNuke Shows Some Gravatar Love!
- The Lessons of CSS Frameworks
- Big, Bold Backgrounds
- Preloading Images with jQuery

Other post in DotNetNuke - Skinning
- DotNetNuke - Skinning - June 5th, 2008
- DotNetNuke Skinning - Getting Set Up - June 10th, 2008
- DotNetNuke Skins - Handling CSS Files - June 12th, 2008
- DotNetNuke Skins - Hello, World - June 17th, 2008
- DotNetNuke Skins - Skin Objects - June 19th, 2008
- DotNetNuke Skinning - Containers - June 24th, 2008
- DotNetNuke Skinning - Standard CSS Classes - June 26th, 2008
- DotNetNuke - Avoiding Container Collision - July 1st, 2008
- DotNetNuke Skinning - Dealing with Images - July 3rd, 2008
- DotNetNuke Skinning - SolPartMenu - July 8th, 2008
- DotNetNuke Skinning - Collapsible Containers - July 10th, 2008
- DotNetNuke Skins - ASCX vs HTML mode - August 27th, 2008
- Infinite DotNetNuke Skin Sets For One Low Price - August 19th, 2009
- Blue Stack Form Enhancer Review - September 30th, 2009
Other Related Items:
Steck Autobody (STK21890) Skin Zipper Door Skinning ToolFeatures and Benefits New Air Hammer driven door skinning tool that skins doors in less than 10 minutes using Skin Zipper’s self lubricating rei... Read More >
Professional DotNetNuke 5: Open Source Web Application Framework for ASP.NET (Wrox Programmer to Programmer)DotNetNuke creator Shaun Walker leads this superlative author team of MVPs while delivering the latest update of a bestseller. They offer complete cov... Read More >
Astro Pneumatic DS1000 Pneumatic Door Skinning ToolThe Astro Pneumatic door skinning tool saves significant time and cost in skinning doors.









