Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to add resources JS files, images, CSS files as embedded resources to my custom web part, I am writing in VS2010. I have set the properties of these files as "Embedded Resources", but I am not sure, what shall I do next from this. Please help!

Thanks in advance!

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

If you are asking how to add them to your project, you can map the Layouts folder by right clicking on your project and selecting Add, SharePoint "Layouts" Mapped Folder. That should create a folder with the same name as your project. Anything that you add will be available globally in the /_layouts// folder.

It is also possible to map to the SharePoint "Images" folder which can be used for /_layouts/images.

share|improve this answer
    
I am creating a web part to be deployed on multiple servers, so I am not sure if mapping the Layouts folder will automatically map the folders on all servers. –  Nitesh Sep 8 '11 at 4:51
    
Yes, that is the point. It will place the items in the appropriate folder of any servers it is activated on. This is the supported, best practice way to deploy those items. –  Mike Oryszak Sep 9 '11 at 1:54
    
@Mike.Thx..I will try this –  Nitesh Sep 9 '11 at 9:29
    
Shall I add resources to Sharepoint "Layouts" mapped folder or my web part? –  Nitesh Sep 9 '11 at 12:29
1  
@Nitesh Please note that Mike's suggestion is how to link to a script and not embed. –  Roman Jul 17 '12 at 0:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.