If you want to get the all sharepoint site users and their groups you need to do following steps Step1: open notepad and paste below script in that and save that file with the extension of ".js" ExecuteOrDelayUntilScriptLoaded(retrieveAllUsersAllGroups, "sp.js" ); function retrieveAllUsersAllGroups() { var clientContext = new SP.ClientContext.get_current(); this .collGroup = clientContext.get_web().get_siteGroups(); clientContext.load(collGroup); clientContext.load(collGroup, 'Include(Users)' ); clientContext.executeQueryAsync( Function .createDelegate( this , this .onQuerySucceeded), Function .createDelegate( this , this .onQueryFailed)); } function onQuerySucceeded() { var userInfo = '<tr>' ; var grouname = '<tr>' ; var text = "<table><tr><th>GroupName</th><th>GroupMembers</th></tr>" ; var groupEnumerator = collGroup.getEnumerator(...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.SharePoint; using Microsoft.SharePoint.Administration; using Microsoft.SharePoint.Navigation; using Microsoft.SharePoint.Publishing; namespace ConsoleOperations { class AddingNavigationLinks { static void Main(string[] args) { using (SPSite site = new SPSite("http://localhost:5030")) { site.AllowUnsafeUpdates = true; using (SPWeb web = site.RootWeb) { SPNavigationNodeCollection nodeColl = web.Navigation.QuickLaunch; ...
Open the Newform.aspx in edit mode( <site>/Calendarlist/Newform.aspx?toolpaneview=2) and add the content editor webpart to below the form and paste the below script in html editor of the content editor web part. < script type = "text/javascript" > function HideField(title){ var header_h3 = document .getElementsByTagName( "h3" ) ; for ( var i = 0 ; i < header_h3.length; i ++ ) { var el = header_h3[i]; var foundField ; if (el.className == "ms-standardheader" ) { for ( var j = 0 ; j < el.childNodes.length; j ++ ) { if (el.childNodes[j].innerHTML == title || el.childNodes[j].nodeValue == title) { var elRow = el.parentNode.parentNode ; elRow.style.display = "none" ; //and hide the row foundField = true ; break ; } } } if (foundField) break ; } } HideField( ...
Comments
Post a Comment