Sharepoint 2010 general
Set Search Results web part Fetched properties by PowerShell
15/02/2018 12:48
Once we made typo in Core Search Results (SP 2010) web part in Fetched properties xml. This caused error of whole page (not only web part), so page was not editable any more and web part properties couldn't be edited any more via UI. SharePoint Designer also didn't allow to edit this page with web...
User access to custom application page
01/12/2017 12:02
To enable set e. g. edit permissions for only folder for some specific user who is not member of any sp group, we need to deactivate site collection feature Limited-access user permission lockdown mode
Then user can access its folder and doesn't see other content. He can browse,...
Microsoft.Office.Workflow.Pages.dll location
19/10/2015 17:21
You can find it in C:\inetpub\wwwroot\wss\VirtualDirectories\yourWebApp\_app_bin\Microsoft.Office.Workflow.Pages.dllc:\inetpub\VirtualDirec
Set Sharepoint Timer job description
06/10/2015 13:56
Usually we want to set not only custom timer job title, but also description. When to try to set it, you will find out it is read only property. Solution is to override this read only property as followingpublic class MyCustomJobDefinition : SPJobDefinition{ public override string...
Deploy file to Sharepoint using Module
21/07/2015 16:11
This code deploys FileName.xsl to Style library/MySubfolder folderAdd New item/Module in Visual studioGive it the name, rename sample.txt to FileName.xslUpdate Elements.xml file according to code below<?xml version="1.0" encoding="utf-8"?><Elements...
SharePoint Timer Job properties
25/06/2015 14:07
//This code is used in override Execute() method in class inherited from SPJobDefinition //read application settings from OWSTIMER.EXE.CONFIG in C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN string siteUrl =...
Create custom NewForm programmatically
19/06/2015 16:58
public static string CreateNewForm(SPList list){ SPFolder rootFolder = list.RootFolder; SPWeb web = list.ParentWeb; string newFormUrl = string.Format("{0}/{1}/NewFormCustom.aspx", web.ServerRelativeUrl, rootFolder.Url); var newForm = web.GetFile(newFormUrl); if (newForm !=...
Create wiki page programatically
19/06/2015 11:11
This example creates wiki page on site collection created from Enterprise wiki templateAdd reference to Microsoft.SharePoint.PublishingSPWeb web = SPContext.Current.Web;string tit = "My code article 3";string articleTitle = string.Format("{0}.aspx", tit);PublishingWeb pWeb =...
Define web part properties in C#
18/06/2015 09:15
private const string WpPropertiesCategory = "My category"; [WebBrowsable(true)][WebDisplayName("Template File Name")][Category(WpPropertiesCategory)][Personalizable(PersonalizationScope.Shared)]public string ExcelTemplateFileName { get; set; }[WebBrowsable(true)][WebDisplayName("File...
SPGridView filter not working
04/06/2015 17:43
- SPGridView connected to datasource, but filter was not applied even if it was there.- By comparing two examples I have found following difference in .designer file generated by Visual StudioWhen I commented out first row and added row below, filter suddenly started to...
Client Object Model
Upload file to Sharepoint using client object model
04/02/2013 00:53
First add references to 'Microsoft.SharePoint.Client' and 'Microsoft.SharePoint.Client.Runtime' dll's. You can find them in 14\ISAPI folder if not in GAC.
Help reference from:...