Click here to Skip to main content
13,556,733 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
Hi Friends,

Please suggest me to recognize the browser microsoft edge with any c# call.

I am tried with below.

System.Web.HttpBrowserCapabilities browser = HttpContext.Current.Request.Browser;

Thanks,
Ramana

What I have tried:

System.Web.HttpBrowserCapabilities browser = HttpContext.Current.Request.Browser;
Posted 7-Dec-17 5:18am
Updated 7-Dec-17 8:39am
v3

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

This is how you do it, How to: Detect Browser Types and Browser Capabilities in ASP.NET Web Forms[^], although my version of Edge reports Request.Browser.Browser as Chrome so it does not work 100% as expected.

Just a note, it is bad practice to check for browser in c#. I'd suggest seeing if you can do what you need done a different way.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web02-2016 | 2.8.180515.1 | Last Updated 7 Dec 2017
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100