Sharepoint 2010 general

Sharepoint javascript Search.asmx GetQuerySuggestions

26/03/2015 15:43
Example how to get search suggestions in Sharepoint 2010 using javascript web service call of Search.asmx- update your site collection url- this html page is not supposed to be on sharepoint, if so, you can use relative site collection url from _vti_bin)<html><script type="text/javascript"...

Call Sharepoint Search service from Console Applicaton

26/03/2015 11:25
When we need to call Search.asmx service from other sites, we can use following code:(first Add Web Service Reference to your console application project and name it e. g. SearchWS)Update your site collection url and your credentials if needed(If you get an error, check if Web application is not in...

Add custom style to CEWP

30/01/2013 13:08
Add custom style to Ribbon in Content Editor Web Part edit mode. It's about styles, not markup styles Link: https://sharepointroot.com/2010/05/28/adding-styles-to-ribbon-in-sharepoint-2010/ some more information: https://mosshowto.blogspot.sk/2009/12/sharepoint-2010-wiki-styles.html

Display Error Messages on Sharepoint Site

09/01/2013 14:05
modify Web.config in inetpub (for your web application) - change-as admin, iisreset CustomErrors mode="Off" Callstack="True" Debug=true

Approve all files in library

30/10/2012 21:43
  internal static void ApproveAllSubfolders(SPFolder folder, StringBuilder writer, bool needsApproval)         {             if (folder.SubFolders != null)             {        ...

Write error to log

28/10/2012 18:46
//define category, not needed to use static or internal //Area will be 'Unknown' in this case   internal static SPDiagnosticsCategory category =             new SPDiagnosticsCategory("Approve Files", TraceSeverity.Unexpected,...

Detect if Approving Enabled

27/10/2012 16:30
   string libraryName = "Style library"; //this describes library settings/version settings //you have to approve file                      bool approvingEnabled = Web.Lists[libraryName].EnableModeration;   //it's...

Recursive function to go through folders

27/10/2012 14:09
   SPWeb web = SPContext.Current.Web;             string folderUrl = SPUtility.ConcatUrls(web.Url, "Pages");             SPFolder folder = web.GetFolder(folderUrl);            ...

HttpContext in SPItemEventReceiver

20/10/2012 21:01
   //to get Current HttpContext insied of SPItemEventReceiver... (HttpContext.Current is always null as this is asynchronous event receiver)                 HttpRequest request = new HttpRequest(string.Empty, properties.Web.Url,...
<< 1 | 2 | 3

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

Lists and Fields