Archive for April, 2013

Differentiating File/Folder in SharePoint Eventreceiver

EventReceiver

You can hook SharePoint eventreceivers to lists and libraries to execute custom code whenever a new document is being uploaded to a document library. The ‘ItemAdding’ event fires when a user adds a new document to a library, but also whenever a new folder is created. However, due to the vast variety of ways to upload a document (one document, multi-document, WebDAV, Office, WebService, etc.), the event always seems to behave a little different.

Having a reliable way to check whether the user added a new document or created a new folder in a document library is key for a solid eventreceiver.

(more…)

Reading SharePoint querystring values in JavaScript

QueryStringJavaScript

JavaScript is becoming more and more popular as a language for SharePoint solutions. Time to get familiar with the built-in JavaScript repository. I have seen quite of different ways to retrieve querystring parameter values in JavaScript, but SharePoint features it’s own function ‘_spGetQueryParam(p)’.

(more…)