Loading ...

Detect IE along with IE11 in C# | CodeAsp.Net

Detect IE along with IE11 in C#

 /5
0 (0votes)

There is different logic to detect IE11 in C#. It can be done via:

Regex.IsMatch(current.Request.UserAgent, @"Trident/7.*rv:11")

So over all IE detection can be done via:

        public static bool IsIE()
        {
            HttpContext current = HttpContext.Current;
            return current.Request.Browser.Browser == "IE" || Regex.IsMatch(current.Request.UserAgent, @"Trident/7.*rv:11");
        }

Comments (no comments yet)

Top Posts