April 26, 2024

SamTech 365

PowerPlatform, Power Apps, Power Automate, PVA, SharePoint, C#, .Net, SQL, Azure News, Tips ….etc

Issue with including JS files in SharePoint web parts

Hi guys,

I came yesterday to the following issue when I tried to load the bootstrap.min.js file in my SharePoint 2010 Visual Web Part

<SharePoint:ScriptLink ID="BootStrapScriptReg" Name="bootstrap.min.js" runat=server />

I was stopped by the following error message

Cannot make a cache safe URL for filename, file not found. Please verify that the file exists under the layouts directory.

Where should we put the .js file ?

Important question, as  a web developer, you think this should go to the root level of your site, or event the site assets ?

Nope !! this has to be deployed in the FRONT END server in the 14 folder

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033