Imran Akram's blog

Let's talk about life, technicalities, career opportunities, current affairs and a lot more!

How to detect a mobile browser in ASP.NET

I’ve been having this issue with mobile development for quite sometime that I couldn’t get the mobile browser accurately by just using the Request.Browser.isMobileDevice property and I’ve found this piece of code here Looks pretty useful. public static bool isMobileBrowser() { //GETS THE CURRENT USER CONTEXT HttpContext context = HttpContext.Current; //FIRST TRY BUILT IN ASP.NT [...]

  • Share/Bookmark