I know I can use Request.Browser.IsMobileDevice
.
But does anyone know how it works, and if it is reliable and up to date?
Thanks!
You are looking for this. Put it in a folder in the App_Browsers
folder. http://mdbf.codeplex.com/
If you're going to use the latest and greatest features available you should take a look into the IE9 demo for Media Queries to make your decision by checking the current screen resolution.
This question needed some 2018 love. Try this.
if(Request.Browser.IsMobileDevice){
// do something
}
You shouldn't need any @using
statements for this, but if you did Intellisense would you tell and help you add it with a click.
And if you need some more advance and mature, then try WURFL.
You need to regularly update BrowserCaps to keep it up-to-date.
http://www.asp.net/mobile/device-updates/instructions/
Note: (Aug 25 2012) apparently the page has been removed.