Tuesday, May 18, 2010

Provisioning Image files to LAYOUTS folder using Visual Studio 2008

To access images using /_layouts/images in the url, the image files need to be located in 12 hive\TEMPLATE\IMAGES folder. Here is how we can use Visual Studio 2008 to deploy these images with a click of a button.

Add folder structure as depicted in the following image inside Visual Studio Project,

Make sure required images are added to correct folder. It is NOT "LAYOUTS" folder. Instead, the images need to be added to TEMPLATE\IMAGES.

Once images are added, deploy solution. This will copy the images to 12 hive (RootFiles) and we can use the image using "_layouts/images/imagename" URL.

NOTE: In SharePoint 2010, there is a concept of MappedFolders in Visual Studio 2010 for the same purpose.

Technorati Tags: ,,,

No comments:

Post a Comment