views:

12

answers:

1

My code looks at the browser you are using to see if you have a correct browser to run the website (I know, I am getting rid of it).

The site has ran fine until today. The code looks is:

Request.Browser.Browser.ToLower().indexOf("firefox")

When this == -1 then I get sent to a page saying "please upgrade". Like I said, this used to work, but now it doesn't. I am now getting: Request.Browser.Browser = "Mozilla" with Firefox as my browser, and I am being sent to the upgrade page.

Did something change? I had 3.6.11 and it worked until today, then it failed. I upgraded to 3.6.12 and the code worked ... for a while. The code now constantly fails. I installed 3.5.15 and the code still fails.

A: 

If you want to detect the browser (avoid that, please), use some well tested function/lib. Detecting the user's browser is a pain, so don't try to do figure it out yourself quickly, because you won't get ir right.

I suggest this lib.

Edit: I'm running FF 3.6.12, and it is detected just fine.

mdrg