Search code examples
asp.nethttpbrowsercapabilities

Why does HttpBrowserCapabilities not work at all?


I've got a web app targeting .net 3.5 and im trying to render browser specific content, specifically targeting iPads. I've visited my page from various browsers including iPhone, iPad, Chrome, Safari and the Request.Browser variables always seem to be wrong. Apologies for the rant, I thought this was a .Net feature that worked out of the box.


Solution

  • This feature can be made to work by copying .browser files into your application App_Browsers folder. By default they live in %SystemRoot%\Microsoft.NET\Framework\version\CONFIG\Browsers.

    Even still for some reason it was not detecting the different browsers that I was using, however I discovered the OceanAppleWebkit.browser by Owen Brady which worked immaculately for my purposes. It may be a bit dated by now but if you know of any updated sources for .browser files it would be appreciated if you post a comment with a link. Thanks!

    http://owenbrady.net/browsercaps/