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?
|
4
|
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:
VirtualPath="/myPathHere/*" Recommended: 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. |
||||||
|