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
<browserCaps> <result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> <filter>isMobileDevice=false</filter> </browserCaps>
- 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
- 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!