SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My colleague just reported that he developed a master page with embedded JScript using Windows Server 2003. The same master page fails to execute the JScript when used on a Windows Server 2008 front-end. Has anyone faced a similar issue? Any information on the root cause?

share|improve this question

Is the JScript running server or client-side? If server-side, SharePoint's safe mode parser will block the request. This is SharePoint's protection mechanism to deal with the fact that end users can add content to SharePoint pages. If client-side, it could be the same issue, I'm not 100% sure.

Assuming it is indeed the safe mode parser which is preventing your script executing, you have two options, one recommended, one defintely not:

Not recommended:

Edit the PageParserPath declaration in web.config to allow in-line script:

AllowServerSideScript="true" />


Create a control (user control, server control, whatever) to output your script. Ensure a SafeControls entry is added to the application's web.config for this assembly/namespace/class - you are effectively telling SharePoint this code is safe to run by doing this.

The first option is not recommended as it's likely you will open security holes by doing this e.g. some code could be added to a page somewhere else (where you weren't expecting it)which is being allowed to run because you've disabled the safe mode parser. Very dangerous.

share|improve this answer
Thanks, we'll check the safe mode parsing option, although it is not likely to influence this. The script should be running on the client side. I still need to check whether it gets to the browser at all... – Alexey Krasheninnikov Jan 11 '10 at 13:55
And yes, I already recommended him to use Jan Tielens's SmartTools approach (Delegate Control to AdditionalPageHead content placeholder). – Alexey Krasheninnikov Jan 11 '10 at 13:57

Your Answer


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.