Thursday, May 12, 2011

Getting Capabilities from WURFL in ASP.NET

This is one of those things that took me a little too much time to find the first time around.

I'm using WURFL with 51Degrees for mobile device detection in an ASP.NET MVC application. I needed to also detect whether the device using the app is a tablet or not. WUFL has the "is_tablet" capability defined, but this is not a default property on the Browser object.

So how do you get at the value for the current request? It's pretty simple once you see it:

Request.Browser["is_tablet"]

No comments: