Sharepoint 2010 general

Create Custom action

03/06/2015 17:22
 Custom action as link to Settings.aspx to our custom Application page- Add Module element in Visual Studio- Remove Sample.txt- Make sure Module is present in correct feature- Modify Elements.xml as following<?xml version="1.0" encoding="utf-8"?><Elements...

Create taxonomy field programatically

03/06/2015 16:38
This code creates taxonomy field (hidden note field is also created by sharepoint)- Add reference Microsoft.SharePoint.Taxonomy- add using System.Linq;- Use your own Logging class- field.IsPathRendered = true; setting is not needed, it was our customer request public static TaxonomyField...

Set Sharepoint Url field

02/06/2015 10:07
 SPListItem item = list.GetItemById(2); string fieldName = "myFieldInternalName"; SPField urlField = item.Fields.TryGetFieldByStaticName(fieldName); if (urlField != null) {  SPFieldUrlValue urlValue = new SPFieldUrlValue();  urlValue.Url =...

Custom action content type binding not working

18/05/2015 10:18
I had issue with binding following action to content type, it was not working as expected. I used web feature and I tried to use content type id value generated by Visual Studio. I found some articles for this issue and it was generally about capital letters in content type id. Here is the list of...

Sharepoint Timer Job configuration

14/05/2015 14:43
Option configuration file OWSTIMER.EXE.CONFIG1. Open OWSTIMER.EXE.CONFIG file in C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN2. Add appSettings node to configuration node3. Modify your code, add reference to System.Configuration.dll and use call string...

SharePoint List Helper class

12/05/2015 11:53
This class is used for common list item operation, get or set the value to/from list item safely - Create ListHelper.cs class in your project - copy and paste following class definition - this class uses Logging.cs file, but if you have your own logger, just update appropriate method...

SharePoint Logging class

12/05/2015 11:34
Here is the content of Logging.cs file, basic SharePoint logging- Add new class to your project, name it Logging.cs- Copy following text into it (replace only class definition, leave your namespace as it is)using Microsoft.SharePoint.Administration;using System;namespace...

Assembly tokens in Visual Web Part

14/04/2015 13:53
Visual web part assembly tokensin .ascx file<%@  Assembly  Name="$SharePoint.Project.AssemblyFullName$" %>in .webpart file  <type name="yourNamespace, $SharePoint.Project.AssemblyFullName$" />

Connection string example

10/04/2015 16:36
 <add key="MyConString" value="Data Source=mySqlServerName;Initial catalog=myDbName;Integrated Security=True;" />

Sharepoint javascript Search.asmx QueryEx

27/03/2015 11:01
Use following html / js call to get search results from Search.asmx service by using QueryEx method.- Replace siteUrl in ajax call with your- Parsing is not correct, but you can see the service response<html><script type="text/javascript"...
<< 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