determining client browser in codebehind
Posted on 2014-01-22
I'm trying to determine the client browser being used, via code on the server. Is this possible? I tried these objects: Page.Request.UserAgent and Page.Request.Browser.Browser. I've read that this is the way to do it. However, what I see does not make sense to me.
If the browser is Firefox, Page.Request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0"; Page.Request.Browser.Browser = "Firefox".
If the browser is IE, Page.Request.UserAgent = ""Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"" Page.Request.Browser.Browser = "Mozilla".
How can this be? What is the correct way to determine the browser?