Can anyone help? I want to use the free service from 51Degrees not the Lite version however the Cloud API (https://51degrees.com/compare-data-options).
I am trying to set my Global.asax to have a display mode for "tablet" and "mobile" so I can use:
- index.cshtml
- index.tablet.cshtml
- index.mobile.cshtml
The following works when not using 51 Degrees. Has anyone got an example how to integrate the 51 Degrees Cloud API with the global.asax to filter for tablet/mobile.
https://51degrees.com/Support/Documentation/APIs/Cloud-API/NET-Cloud
DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("Tablet")
{
ContextCondition = (ctx =>
ctx.Request.UserAgent.IndexOf("iPad", StringComparison.OrdinalIgnoreCase) >= 0 ||
ctx.Request.UserAgent.IndexOf("Android", StringComparison.OrdinalIgnoreCase) >= 0 &&
ctx.Request.UserAgent.IndexOf("Mobile", StringComparison.OrdinalIgnoreCase) <= 0
)
});
Thanks Tommy