Wednesday, June 09, 2010

SharePoint 2010 development errors and fixes

Hi Folks,

I want to share 2 errors i was getting while working with the ECMA Javascript Client Object Model in SharePoint 2010.

Error #!: only content controls are allowed directly in a content page that contains content controls. script

Why : when you have script block outside the content controls in your application pages in sharepoint 2010.

Solution:
Add your Script block on the PlaceHolderAdditionalPageHead
In your application page.

Error #2: Cannot make a cache safe URL for "1033/sp.debug.js", file not found. Please verify that the file exists under the layouts directory.

Why this happen? Because SP.debug.js doesn't exist under layouts folder in sharepoint 2010.

Fix: Copy your SP.debug.js from this file path:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS

and paste it on the following directory:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033

Hope this helps.



Regards,
Mostafa arafa

1 comment:

Unknown said...

A contribution from Amir Sofi :

"I know this is an old post of yours, but it's the first hit on Google
for this error, so here's another solution that doesn't involve
copying files on the server. I tried posting to your blog, but you
have it restricted to team members.

Add Localizable="false" to the SharePoint:ScriptLink tag. That'll
allow SharePoint to find it at its original location.



"

Thanks Amir for this contribution.