tags:

views:

31

answers:

1

Hi,

I have a asp.net website in which i check for supported browser. That is i user Request.Browser.Browser -- for the browser name and Request.Browser.MajorVersion for the browser version

Problem here is browser Safari and Google Chrome show me the same value !!! That is AppleMAC-Safari(name) and version would be 5..

How do i differentiate between google chrome and safari then ???

Thanks , Francis P.

A: 

For each browser that Request.Browser.Browser can detect, there must be a *.browser file in C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers. Chrome and Safari are missing in version 2 of the .NET framework, but you can download an updated set of browser configurations from codeplex: http://aspnet.codeplex.com/releases/view/41420

There could possibly occur some compatibility issues (since these files are made for .NET 4). In such cases you may have a look at this blog post: http://stephenwalther.com/blog/archive/2010/03/05/use-asp.net-4-browser-definitions-with-asp.net-3.5.aspx

Dave
Thanks that worked just fine :)
francis
If i replace all the config files under the Browsers folder with the new one which are lesser compared to the Browser configs in version 2 . Is that going to make any difference ?
francis
I'm not sure, but it seems as there are a lot of config files for legacy browsers in v2, which aren't really used today.
Dave