.NET Answers

ASP.NET, HTML, CSS, Visual Studio, CSharp, VB.NET and other programming items of interest.
Subscribe
  • Home
  • About Me
  • Advertising
  • Click Here to Ask a question
    • Privacy Policy
  • Site Map

DotNetNuke Skinning – Dealing with Images

July 03, 2008 By: Dave

A graphical depiction of a very simple css doc...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

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Related Post

  • DotNetNuke Skins – ASCX vs HTML mode
  • DotNetNuke Skinning – Collapsible Containers
  • DotNetNuke Skinning – SolPartMenu
Bookmark to:

Add to Del.icio.us Add to digg Add to DotNetKicks Add to DZone Add to Facebook Add to Slashdot Add to Stumble Upon Add to Technorati
Hide Sites
Tags: dotnetnuke, skinning

Comments are closed.

← Catching Data for Performance
Compiler Error Message: CS0016 →
  • Search

  • Subscribe

    U COMMENT
    I FOLLOW

    Subscribe in a reader

    OR

    Subscribe via e-mail

    Enter your email address: 

    Delivered by FeedBurner

     

  • Follow Me

    • Twitter
    • FaceBook
    • Digg
    • StumbleUpon
    • Propeller
    • Delicious
    • Plaxo

     

  • Recent Posts

    • ASUS Eee PC 1005HA-PU1X-BK Black Netbook
    • jQuery – Date Picker
    • Using VB.NET From CSharp
    • iTextSharp – Adding Images
    • Hungarian Notation – Use What Works, Spit Out The Bones
    • Pre Order Windows 7
    • jQuery Dialog – With Validation Controls
    • iTextSharp – The easy way
    • Structure of my ASP.NET Web Applications
    • 35% Off Accronis True Image 2009 Home
    • VB.NET Hide Module Name
    • ASP.NET/VB.NET – Video Training
    • Does jQuery Make Us Lazy?
    • PDFs Using iTextSharp
    • Programming SEO – Ping



  • Advertise on this site through Lake Quincy Media
  • DotNetNuke Sponsor

     

    Most Valuable Blogger
  • Sponsor

  • Categories

    • Advanced CSharp
    • Advanced VB.NET
    • ASP.NET MVC
    • Did you know
    • DotNetNuke – Module Development
    • DotNetNuke – Skinning
    • internationalization
    • iTextSharp
    • jQuery
    • none
    • Seach Engine Optimization
    • Silverlight
    • SQL For Programmers
    • Twitter
    • winforms
  • Cloud

    .net ajax architecture asp.net book books containers csharp css dal dataset datasets dotnetnuke events gridview images internationalization internet explorer javascript jQuery json linq listview modules ms-sql MVC objectdatasource programming reflection seo Silverlight skinning sql testing tsql tutorial Twitter twitterizer vb.net video view Vista visual studio webservice WordPress
  • Archives

    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
    • Privacy Policy
  • Calendar

    July 2008
    S M T W T F S
    « Jun   Aug »
     12345
    6789101112
    13141516171819
    20212223242526
    2728293031  
  • Blogroll

    • Alvin Ashcraft’s Morning Dew
    • ASP.NET Consulting
    • Life Hacker
    • Remember Anything
    • The Price of Their Toys
    • Uncategorized Thought


.NET Answers © 2007 - 2008 All Rights Reserved.
Entries and Comments.