Identifying IE11 compatibility mode in SharePoint

IE11 compatibility view emulator

This post describes how to figure out if IE11 has jumped in the compatibility mode and therefore screws up your CSS.

Compatibility view now and before

Microsoft has been pretty keen on introducing new ways to handle browser compatibility and make IE behave in even stranger ways that it usually does by switching it to compatibility mode. There are a few reasons this could happen, but perhaps the most usual one in SharePoint’s case is that IE identifies the SharePoint site to be located in intranet zone, or it’s set to that zone or the list of sites to display in compatibility mode via a group policy.

Before IE11 the switch was reasonably easy to notice – there would be a button/icon similar to this on the address bar, when the browser was in compatibility mode:

IE 10 compatibility mode

IE 10 compatibility mode

However, in IE11 Microsoft has removed the icon leaving us in the dark about whether the page is in compatibility mode or not. We COULD check the compatibility view and security zone settings to find out the mode, but there’s a better way, too. Now, we must check the developer tools (F12 brings them up) to see, which document mode is activated. IE11 in compatibility view may show us something similar to this:

IE11 compatibility view emulator

IE11 compatibility view (emulator)

But wait a minute – what if you can’t access the end user browsers yourself? Before it was pretty easy – you could just ask the end user to check for the compatibility view icon, as it was easily visible on the address bar, but nowadays you’re mostly out of luck – instructing the end users to actually use developer tools is probably going to be difficult. However, there’s a workaround for this.

Continue reading

Simplest way to create a thread on SharePoint

Stock photo from pixabay.com

This post describes the (probably) easiest and most straightforward way of creating a new Thread in your SharePoint (or any other .NET) server-side / desktop code.

Solution: how to create a Thread

Let’s face it – one should not create new Threads lightly when developing SharePoint solutions, but sometimes it’s difficult to avoid. This one time we were developing a pretty simple functionality, where we needed to create a few fields on a certain title when user activated a feature. However, because of the complexity of the environment, we encountered problems changing the title of the new field. Now, it’s usually pretty simple, but this time some other functionality, most likely developed by someone else, was changing it to the internal field name – which doesn’t look to good.

To be honest, we’re not even sure, why this worked. We suspected it might be because of the current culture of the thread, but changing it didn’t have any effect. Any way, we’re glad this worked, whatever the reason for that is.