DotNetNuke, ASP.NET, Web Development Blog

Image paths and skins

Something I've learned several times and have subsequently forgotten several times is that skinpath only works when your image does not specify runat="server".

When creating a skin, you often want to include images. This can be a bit tricky as DNN's friendly URLs makes it so that your path may be very different for the same page, i.e. www.efficionconsulting.com/default.aspx is the same as http://www.efficionconsulting.com/Home/tabid/1/Default.aspx. This means that most relative paths just won't work, i.e. /images/spacer.gif, image/spacer.gif, ... You can use more hard coded paths such as ~/Portals/0/_default/efficion/images/spacer.gif but that really limits flexibility as if you want to install the same skin as a site specific skin on a different DNN instance.

SkinPath is a great new feature where DNN will figure it out for you. Though I don't know why it won't work when runat="server is used"... Scott Wilhite has a nice write-up on this in this post.

Comments

Leave a Comment
Gravatar
Name:
Email: (not displayed)
Comments:

CAPTCHA image
Enter the code shown above:
Website

Return to previous page