tags:

views:

56

answers:

4

I am little confused with available approaches to store my web part images. I found that i can store images which are being used in my Web Part at following different location

1. [12Hive]/TEMPLATE/LAYOUTS/1033/IMAGES
2. 80/wpresources/[AssemblyName]
3. [12Hive]/TEMPLATE/LAYOUTS/[Project specific folder]/Images/

Can any one suggest when to use which approach ?

Thanks.

A: 

Best approach is \12hive\TEMPLATE\IMAGES 3rd option is also not bad.

Hojo
+1  A: 

You should store them in the _images virtual directory (.../12/template/layouts/images on disc), in a new, project specific subdirectory, and reference them in your application using _images/My_Dir/My_Image.jpg.

OedipusPrime
+1. Keeping projects separated can't be understated.
pst
A: 

/wpresources/[AssemblyName] is ok for Microsoft.SharePoint.WebPartPages.WebPart derived web parts, because you can reference the location from within the web part using this.ClassResourcePath.

This is not available in System.Web.UI.WebControls.WebParts.WebPart derived web parts though.

Paul Lucas
A: 

I use 12\TEMPLATE\IMAGES\MyProject.

You can then reference it in any page or css file as '_layouts/images/myproject/myimage.gif'.

Rich Bennema