Wednesday, 30 July 2014

sharepoint check in and publish folder using Powershell

Add-PSSnapin "Microsoft.SharePoint.PowerShell"### GLOBAL VARS, CHANGE HERE$listname = "Style Library" $url = "http://abcd:1234/sites/TestSite/"function approveContent ($w, $listName) {  $list = $w.Lists |? {$_.Title -eq $listName}  foreach ($item in $list.Items)   {    if(($item -ne $null) -and ($item.LockId -ne $null)) {      $item.ReleaseLock($item.LockId)   ...
Continue Reading...

datetime picker in sharepoint c#

Design Code:-                       <SharePoint:DateTimeControl ID="dtpstartDt" DateOnly="true"  runat="server" IsRequiredField="true" CalendarImageUrl="/_layouts/images/calendar.gif"                CssClassTextBox="itw-longDate"  LocaleId="7177" ToolTip="Example: 2000-12-31"               ...
Continue Reading...

Programmatically Check Current user in SharePoint Group using C#

 public void CheckcurrentuserinGroup()        {            SPGroup grp = SPContext.Current.Web.SiteGroups["GroupName"];            if (grp != null)            {               ...
Continue Reading...

get user profile properties programmatically using c#

 public void getuserprofilesyncCustomattributesvalues(string MysitecollectionUrl)         {             SPSecurity.RunWithElevatedPrivileges(delegate             {                 using (SPSite siteCollection = new SPSite(MysitecollectionUrl))                ...
Continue Reading...

Programmatically Delete all Item in SharePoint List using c#

                public static void DeleteAllItems(string list)         {             SPSecurity.RunWithElevatedPrivileges(delegate             {                 using (SPSite spSite = new SPSite(SPContext.Current.Site.ID))          ...
Continue Reading...

Set default master page and welcome page in sharepoint 2013 using Event receiver

 void ChangeMasterPage(SPWeb Web, string pstrMasterURL, string pstrCustomURL)        {            Web.MasterUrl = pstrMasterURL;            Web.CustomMasterUrl = pstrCustomURL;            Web.Update();           ...
Continue Reading...

Followers

Follow The Author