Tag Archives: Mobile Development

SharePoint 2010 | Disable Mobile Detection on a SharePoint Website

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

2. 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.

    <result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

Windows Phone–Free Training on March 24th

Hey Devs,

This Saturday, March 24th, at the LA Microsoft Office!!!

You don’t want to miss this! Not only is this full day of training absolutely FREE, but there is $800 in prize money, and they are giving away three Nokia Lumia 800 phones! And if that wasn’t enough, you will get fed all day as well.  Breakfast, lunch and dinner!  You can’t beat that.  All the information you need can, and the registration link is below.



Agenda: Introduction to Windows Phone 7 Programming

In this session, we start with a discussion of windows phone, the architecture changes made from 6.5 to 7.0, the hardware specifications and then move into the beginnings of building a WP7 application including…

  1. Application life cycle
  2. Hardware Foundation
  3. Files associated with project template
  4. Splash screen and the importance of 1 second / 19 second loading
  5. Application Bar
  6. Panorama and Pivot controls
  7. MVVM
  8. Marketplace

Connecting to Services

In this session, we will discuss how Cloud Services help to bring power to the phone. We will be binding to a rest based services and show how to search and display the information received. In this session we will also talk about Navigation, passing information between screens, while working with List and detail information.

  1. Navigation
  2. Location
  3. JSON Deserialization
  4. Bing Maps
  5. Isolated Storage
  6. Binding Sample Data
  7. Navigation

Recording Data

In this session we will be adding to our knowledge and learn the importance of live tiles. We will show you how to set up a periodic agent and how to set up and read and write to a SQL Database on Windows Phone.

  1. Live Tiles
  2. SQL CE
  3. Background Processes and Periodic Agents
  4. Launchers and Choosers