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

I customized my ribbon with customactions. These commands of the customactions call some cool Javascript functions from a file (ex. script.js). I include this file with:


Now this file is loaded on every page, and not just on the list-definition I want it to be (RegistrationId="1234"). I can't define a registrationId because the location is ScriptLink.

Is there an easier (and nicer) way than to do it over the Client object model to find out if I'm in the right definiton?

share|improve this question
up vote 4 down vote accepted

An alternative to using a CustomAction with the ScriptLink location would be to use a delegate control with the control id of AdditionalPageHead. That way your server side code in your control could determine the context and output the javascript appropriately.

share|improve this answer
thanks man. that could be something – domueni Nov 22 '11 at 15:16

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.