Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 3 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

 
discard

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.