How to check mobile device in asp.net mvc view
Microsoft Net Framework
  • .Net
  • 526
  • January-21-2018
  • by 

How to check mobile device in asp.net mvc view?

Problem:

I have a webpage or mvc view, i want to show data accroding to  mobile device or web page. some information will be for  mobile users and some information for  laptop/users.

Below are few lines that will detect device mobile .

public static bool IsMobileDevice()

{

var myBrowserCaps = System.Web.HttpContext.Current.Request.Browser;

return myBrowserCaps.IsMobileDevice;

 

}

 

How to check mobile device in asp.net mvc view

Share This with your friend by choosing any social account


Upcoming Articles
You may also read following recent Post
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM