SharePoint: Half-Initialized Folders

I discovered something weird when trying to detect document library folder by URL. It is possible to create folder objects that are half initialized. I tried to ask folder by URL and I used URL of documents list view. The result – folder with correct name etc but many parameters were missing.

By example folder.Item returned me null. I got exception when I wanted to ask folder’s unique ID. There were also many other parameters missing. But some parameters were correct. Somewhy I got half-initialized bastard instead of correct folder object I expected.

Solution was simple – when asking folder by URL you have to give same URL you can use to open the folder in Windows Explorer. Using these URL-s you get always correct folder objects from web object.

See also

Leave a Reply

Your email address will not be published. Required fields are marked *