How to detect a mobile device in ASP.NET

ASP.NET Developers can detect a mobile device using the following ASP.NET code:

C# in Depth, 3rd EditionManaged Windows VPS Hosting

if (Request.Browser.IsMobileDevice)