Pull the information about all the subsites under a root site collection

Here I am giving a sample code which will iterate all the subsites of a root site collection and display some information. 1: using System; 2: using System.Collections.Generic; 3: using System.Text; 4: using Microsoft.SharePoint; 5:  6: namespace SubSiteReport 7: { 8: class Program 9: { 10: static void Main(string[] args) 11: { 12: Console.WriteLine("Enter your…

3

Best Practices: SharePoint Object Model for Performance Tuning

I am writing this post because of being inspired by couple of performance related cases that I had worked with my customers also one of triages that I had attended and it was taken by our Escalation Engineer Nishand. He did a very good job by finding out the inside edge of SharePoint APIs and…

29

Feature Activation Dependency with Hidden Features !

A Feature activation dependency expresses a requirement in the relationship between two Features. You can express activation dependencies either for Features of the same scope or for Features across different scopes. Please check this link for getting more information about the Activation Dependency. More . Here we are going to talk about the Feature Activation…

5

Programmatically rename a file inside a SharePoint document library

We can’t rename a file using file property SPFile.Name, it will say “Property or indexer ‘Microsoft.SharePoint.SPFile.Name’ cannot be assigned to — it is read only.”, then how we can rename a file ?   Yes, the “name” and “display name” are read-only fields, so you will get an error at the time of compilation. But…

9

Programmatically retrieve the items in a list based on the current user

We can accomplish this requirement by using SPQuery. This sample code I have developed for taking all the items with modified by (column name is “Editor”) user BLR3R7-19C\\test1.If you are using this code in a SharePoint web context then oWeb.CurerntUser will return the current login user details. 1: SPList oList = oWeb.Lists[“Shared Documents”]; 2: SPUser oUser =…

6

How we can work with output cache programmatically ?

Once I got an interesting question from one of our discussion lists about how we can enable output cache programmatically ? and how we can create a cache policy through code. After my research on it I was able to accomplish this one by using the following code snippet. 1: using Microsoft.SharePoint; 2: using Microsoft.SharePoint.Publishing;…

2