I have 1 solution (which is deploying as SandBox Solution).

I have added JavaScript files, Images, Application Page & UserControl in one Module under project folder.

I have one Element.xml file which has CustomAction button for Ribbon. Now in this I want to to add UserControl in this. So I have written,

"Control Id="ControlPageHeader" Sequence="400" ControlSrc="~/MyModuleName/MyTestFolder/MyUserControl.ascx"

And In UserControl, I have added the following line for my JavaScript file reference. "SharePoint:ScriptLink ID="ScriptLink1" runat="server" Localizable="false" LoadAfterUI="true" Name="/MyModule/JS/MyJScript.js">

When I create the package & Upload the solution on my site, Button is displayed in the Site, but when I click on the button, it does not take/do any action.

(Image is not displaying on the button also).

I don't know what is the problem ? Either the reference or path ?

Please help me for this.

1 Answer 1


try the following in your ascx:

<SharePoint:ScriptLink ID="ScriptLink1" runat="server" Localizable="false" LoadAfterUI="true" Name="MyJScript.js"> 

sharepoint i think if memory servers me right will be looking in the 12hive folder of layouts under templates. If you want a folder than add it within the layouts folder


<SharePoint:ScriptLink ID="ScriptLink1" runat="server" Localizable="false" LoadAfterUI="true" Name="/MyModule/JS/MyJScript.js"> 

somthing similar as to what iv said that you could reference:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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