Developers often need to parse an XML document in order to get XML document nodes, child nodes and so on. But usually we have no idea how far the depth/nesting of child nodes can go. So we need some form of recursive technique to loop the nested nodes and help us grab the values we want.
C#
Sending Emails From SharePoint Servers
My previous four-part series described how to set up a SharePoint development farm. Now, what if we want to take things a step further and configure our SharePoint farm to allow sending of outgoing emails? This article discusses everything you need to do to make this possible – from installing and configuring the SMTP service, to defining outgoing email settings in SharePoint Central Administration. I provide code examples as well.
Timer job to delete SharePoint orphaned users
This article discusses how to create a timer job for deleting orphaned users (SharePoint users that are deleted or disabled in AD) using Visual Studio. I have tested this solution on both SharePoint 2016 and SharePoint 2010. So, it would of course also work for SharePoint 2013.
Converting asynchronous SharePoint event receivers to synchronous
If you encounter the edit properties box on single document uploads and still want to run custom code in the ItemAdded event receiver, you will need to employ the method discussed in this article of converting asynchronous SharePoint event receivers to synchronous. The motivation behind this post was to avoid save conflict errors. But there are potentially other scenarios where it might be useful to make asynchronous SharePoint event receivers synchronous.
Setting default column values on items added to a SharePoint folder using code
Depending on the folders into which items are uploaded in SharePoint, you may want to set default column values so that instead of a global column default value, your default values become folder-specific. This article demonstrates how to do this using C# code on a SharePoint 2016 server. The code can be added to event receivers to keep child items updated when something changes somewhere.
Working With Web Services Without Adding A Reference In C#
Generally, when writing code to communicate with web services in C#, the usual process is to add a service reference. Visual Studio then automatically creates all the wrapper classes/objects for you that you need in order to talk with the service. However, sometimes, you want greater control. This article explains and gives you the code needed to work with a regular SOAP based web service without adding a reference.