asp.net mvc - Need WURFL to work only for mobiles -
at present using below code detecting mobiles, tablets. need restrict code mobile. suggestions can appreciated if provided solution.
displaymodeprovider.instance.modes.insert(0, new defaultdisplaymode("mobile") { contextcondition = (context => { var manager = (context.cache[wurflmanagercachekey] iwurflmanager); var cabablities = manager.getdeviceforrequest(context.request.useragent); return cabablities.getcapability("is_wireless_device") == "true"; //return cabablities.getcapability("mobile_browser").contains("opera"); //return cabablities.useragent.contains("opera"); }) });
i use is_wireless_device
, is_tablet
capabilities isolate mobile phones:
if (is_tablet == false && is_wireless_device == true) { //must mobile phone }
Comments
Post a Comment