SharePoint 2010 Master

Recently I had the opportunity to take part in the the 9th rotation of the SharePoint 2010 Master course in Redmond. I had big expectations on the course itself, having heard a lot of good things about it. Among the good things every single master I have talked to pointed out the very demanding and…


Deciphering the encoded claims string

During a recent claims discussion, it came up how SharePoint 2010 encodes claims into encoded claim strings. Here’s the answer: The claim i:0#.w|europe\andrasg translates into: i: This is an identity claim. Other claims would have the character c here. :: Colon separator 0: Reserved for later use #: Claim type = SPClaimTypes.UserLogonName .: Claim value…


Description goes missing on editforms

I had some trouble today finding the reason why descriptions set on fields did not show up on the editform. Turned out that Office Toolbox was installed and even though it was not active, made all descriptions disappear. Retracting the OfficeToolbox wsp solved the problem.


Beware of conflicting field static names

Recently I came across a problem where pushdown of changes on a contenttype did not work when doing a feature upgrade. The appropriate AddContentTypeField command was specified in the feature.xml template: <AddContentTypeField ContentTypeId="averylongidhere" FieldId="{133865E2-17C6-4c42-B98A-D4D09BA43714}" PushDown="TRUE"/> Digging deeper I found no errors when upgrading the feature so I was about to give up when I tried…


The good solution for versioning SharePoint 2010 webparts

Everyone who has had the pleasure of working in a team with other developers and using TFS with auto-incrementing version numbers most probably have faced the issue with webparts breaking after an increment in version numbers. This effect is not at all strange, as SharePoint keep the full signature of the class behind the webpart…


DataFormWebPart XSL variables are emtpy

If you discover that a DataFormWebPart added programmatically is missing values in its built in XSL variables, like HttpVDir or PageUrl, verify that the ViewFlag attribute is set to something other than zero on your webpart. Took me some time to find out… Also, would be nice to know what this property stands for.


What to do when SPContext is null but you need it?

Sometimes you stumble upon really strange errors when doing trivial things. When you dig deeper, sometimes it turns out the error comes from the lack of a HttpContext, for example when running some action through STSADM or a timer job. Recently I faced a strange ArgumentNullException when creating a Content by Query Webpart in C#…


Publishing start and end dates are set brute force

When setting publishing start and end dates on a publishing page, these dates will be saved in the PublishStartDate and PublishEndDate fields of the publishing page. Changing the scheduling settings will result in an immediate change of the page (with the modified by and modified date properties set as well), regardless of the state of…


Anatomy of page lifecycles in SharePoint 2010 publishing pages

  As most of you already know, SharePoint 2010 brings a whole load of nice publishing features out of the box. One of these are the handling of publishing pages. Publishing pages are basically .aspx pages that get their content from the listitem associated to them. You can imagine a publishing page much like any…


Setting Modified by, Editor and other fields when versioning and content approval is enabled

Most of you are probably aware that setting fields like Modified, Editor, Created and Author require some special attention: 1: using (SPSite site = new SPSite("http://sp2010")) 2: using (SPWeb web = site.OpenWeb()) 3: { 4: SPFile f = web.GetFile("/Pages/default.aspx"); 5:  6: f.Item["Modified"] = DateTime.Now.AddDays(-2); 7: f.Item["Editor"] = "-1;#SHAREPOINT\\SYSTEM"; 8: f.Item.UpdateOverwriteVersion(); 9: } So far so…