0

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!

1 Answer 1

2

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.

5
  • 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
    Commented Sep 8, 2011 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. Commented Sep 9, 2011 at 1:54
  • @Mike.Thx..I will try this
    – Nitesh
    Commented Sep 9, 2011 at 9:29
  • Shall I add resources to Sharepoint "Layouts" mapped folder or my web part?
    – Nitesh
    Commented Sep 9, 2011 at 12:29
  • 1
    @Nitesh Please note that Mike's suggestion is how to link to a script and not embed.
    – Roman
    Commented Jul 17, 2012 at 0:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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