Question

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).

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top