I'm developing lots of web parts and of course i'm doing this all locally then uploading to the live online SP2010.

I'm needing to write a lot of extra code to accommodate the file paths of images and CSS files etc and its becoming a bit of a headache, has anyone else ran into this? Any tips or solutions to reduce the number of If then else?!



  • Can you give examples of that you need to change and why are the paths different in your local environment? Commented Oct 15, 2012 at 16:40

1 Answer 1


where are you deploying images and CSS files? is it in some doc lib of the site itself, or in layout folder, if you deploy them in layout folder then you should not run into this problem, just refer your resource with virtual path like "/_layouts/YourFolderName/resource" but for some reason if your files has to be in site's library then I guess you will face some problem if you dont know the library name or library structure at the time of development.

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.