DeviceDetector.NET
DeviceDetector.NET copied to clipboard
How to use this library on Razor pages?
Hi, I am currently using something custom to detect user device and I would like to upgrade to a deeper test with DeviceDetector.NET, is it possible to do this directly on Razor page?
This is my code so far (inside Razor page) for checking the user's device:
// Mobile Detection
string strUserAgent = Request.UserAgent.ToString().ToLower();
var isMobile = false;
if (strUserAgent != null)
{
if (Request.Browser.MobileDeviceModel != "Unknown")
{
isMobile = true;
}
}