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 need to do some client-side alterations to some of the application pages, specifically the permission page (User.aspx). I need the javascript file to remove the "Administrate Parent Permissions" link as a lot of human errors occur because of this.

However, I have found no easy way to 1) put javascript into a master page (and I don't want to edit application.master manually), or 2) dynamically load a javascript on the application.master pages.

The solution is already making use of a custom master page for normal pages that already have scripts included, but this is specifically for application pages only (to the extent possible).

I saw a solution using a HttpModule to dynamically replace the master file on-the-fly, but it seems like a very inefficient way to do it.

Any suggestions are welcome. The end result must just be that the specific menu item is removed from the actions menu on the permissions page. I have tried using HideCustomAction, but it will not work for that specific menu item (it is working fine for others).

share|improve this question

2 Answers 2

up vote 3 down vote accepted

You don't need to touch the masterpage at all. Just create a custom SharePoint DelegateControl as described here

https://littletalk.wordpress.com/2010/11/18/create-an-additionalpagehead-control-packed-into-a-feature-in-visual-studio-2010/

The DelegateControl contains a link to include your script. Once the feature is activated it attaches to any masterpage, even the application.master.

share|improve this answer

You can directly push your script in the Master Page with the CustomAction Element. No need to modify the Master Page manually. Have a look here: http://weblogs.asp.net/jan/archive/2010/03/01/scriptsrc-referencing-javascript-files-with-sharepoint-2010-custom-actions.aspx

I prefer this way because it does not involve touching the 12/14 hive folders.

share|improve this answer
    
Brilliant! I always forget this feature, thanks for reminding me. Sadly it works only with SharePoint 2010, but from what I gather the original poster has SharePoint 2007. Well, we'll see what's true once he replies back. –  Sig Weber Jan 30 '12 at 21:15
    
Yes true. If its 2007, then the delegate control it is! –  Vardhaman Deshpande Jan 31 '12 at 5:45

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.