How to disable mobile view in Sharepoint

Today I’ve received a particular incidence of ene of my costumers, they want to disable the mobile view for Android devices because it throws an error when users access to the portal. They’re leaving responsive design to the dark side 😦

We have different options to do that, so in this post I’ll explain how to do it:

    • Modifications to the web.config filePros
      • Single modification for all devices
      • Can be part of a SharePoint solution (using code)
      • Not overwritten during Service Pack / Cumulative update

      Cons

      • No individual handling

      Go and edit the web.config file of the site (e.g C:InetpubwwwrootwssVirtualDirectories<webapp>)

      Add the following code to the configuration/system.web node

 

&lt;browserCaps&gt;
  &lt;result type=&quot;System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot;/&gt;
  &lt;filter&gt;isMobileDevice=false&lt;/filter&gt;
&lt;/browserCaps&gt;

  •  Modify the compat.browserPros
    • Individual handling of mobile devices / browsers
    • Can be part of a SharePoint Solution (using code)

    Cons

    • Overwritten during service pack

    Go and edit the compat.browser file of the site (e.g C:InetpubwwwrootwssVirtualDirectories<webapp>App_Browsers)

Look for iPhone Safari Browser comment or any other mobile devices you see fit and change the value from true to false. Especially for iPhone Safari Browser, iPod Safari Browser and Android Safari Browser

Turn-Off-Mobile-SharePoint

  • Modify isMobileDevice to false.

No IISReset is required, but some times help 😉

Other resolutions can be found here: http://blogs.technet.com/b/yashgoel-msft/archive/2015/01/15/blocking-access-to-mobile-view-in-sharepoint.aspx

that’s all!

Disable Mobile Acces for Sharepoint

If you have access to the SharePoint file system on your front-end servers, you can disable the mobile
view for all sites in a specific web application’s zone by adding the following in the zone’s web.config
file, inside the <system.web> section:
<browserCaps>
<result type=”System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=4.0.0
.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” />
<filter>isMobileDevice=false</filter>
</browserCaps>