Very often, developers need to execute some code in the context of another user. This article explains how to do SharePoint user impersonation with C# using the Server-Side Object Model (SSOM).
I code in several different programming languages and I post content relevant to the different languages on this website. Software development tools and languages evolve very dynamically. What's hot today may be forgotten tomorrow. So, categorizing my content based on language is not very practical. Instead, I use client-server labeling to categorize my work with various programming languages. This section holds content that I consider to be back-end (or server-side) programming.
This code sample is for developers who use Yoast SEO plugin on their blog and want to publish a post using PHP code. It’s a quick copy and paste method to update Yoast SEO fields.
To delete a folder and its contents using C# is not necessarily as easy and straightforward as you might think. It becomes tricky when one or more files are marked as read-only. Here’s a recursive helper method.
There are lots of programming situations where it is necessary to break up a large amount of work into smaller more manageable pieces or chunks. The technique is known as “Chunking” and is frequently used when a huge list needs to be iterated in batches of say, 100 items at a time.
When binding SharePoint event receivers to lists and libraries, the generic method involves using the ListTemplateId element. The problem with this method is that it adds the event receiver to all lists with a matching ListTemplateId. However, in many cases, we only want our event receivers attached to specific list instances. Here’s an explanation of how to dynamically add an event receiver to lists with specific names across an entire site and its sub sites using C#.
There are a number of resources out there that attempt to explain how to get the network path of a mapped drive letter or path. However, I found most of them to be incomplete and/or full of errors. Two potential solutions are discussed here. One uses PInvoke the other is a pure .NET method.