I am trying to do a “If browser is IE and is less than version 9” in ASP.Net C# codebehind.
However, In chrome, the following line:
if (Request.Browser.Browser == "IE" && Request.Browser.MajorVersion < 9)
Outputs as “IE” & 5 respectively. Despite using Chrome v18.
What is the correct usage for getting the users browser? Or is this just my version of Chrome playing up? It’s probably really simple, but I’m sure this code worked previously
The user agent is registering as:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19
I have v19 and i do see the correct value. Are you sure you don’t have any emulator (user agent emulator) or something like this…
chrome 19
ie 8
and this is the code for this output: