3

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:

<CustomAction
  Id="MyScript"
  Location="ScriptLink"
  Sequence="1000"
  ScriptSrc="/_layouts/FeatureXY/script.js"/>

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?

4

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.