Just a quick brain dump today on the SharePoint mobile experience for those of us who still have to deal with 2010 (Yes, 2013 is so much better for this stuff) since this just came up and I realized I had not yet posted it. The question of reactive vs. adaptive design for a website I’ll leave for another day and the various frameworks you can use with SharePoint like bootstrap to give a single page the full mobile/desktop experience.
In any case, the mobility feature can be turned on or off per my post a couple years back: SharePoint 2010–Mobility Redirect Feature and this is nice, but the feature also has it’s own quirks with dealing with a publishing site, and in some cases even if you turn it off the site still detects mobile browsers and tries to redirect. So, there are two quick ways to disable SharePoint from detecting a mobile browser if you just don’t want to deal with it.
1. This is probably the most tried and true method, just update the compat.browser file found in the site’s App_Browser directory and change the capability of isMobileDevice to “false” for all items that have it set to true.
<capability name="isMobileDevice" value="false" />
That works well, seems like most people use it and move on. Advantages are that you can single out specific browsers and target the user experience, or flip back and forth with certain specific browsers. Bad news is that it can be overwritten when service packs get involved. Microsoft also recommends an iisreset /noforce after you change the file
- This is a little nicer in the sense that it’s a change to the web.config so we can set up a WSP to do this for us (and it won’t get overwritten) and as it’s only a couple of lines in the web.config we can switch back and forth fairly easily in our test and QA environments. Bad news is of course that it uses the browserCaps element in the web.config. Deprecated in favor of the compat.browser file mentioned above, but interestingly still supported all the way up to the .NET 4.0 framework at this time. So, if you want to turn off mobile detection for a site, just drop this in the web.config file of the web application in the <system.web> node. Obviously, as this is a change to the web.config file, every time you change the file the web application will restart.
<browserCaps> <result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> <filter>isMobileDevice=false</filter> </browserCaps>