If you request "default.aspx" from mobile browser, it will redirect to default_mobile.aspx page

Step 1: Request from Mobile User Agent

Change the User Agent (Safari Browser).

Step 2: Request "default.aspx"

A "default.aspx" request automatically redirects to "default_mobile.aspx" because HTTP request is from mobile user agent.

Problem with Latest Browsers

Some of the popular mobile devices/browsers won’t be detected using this way because ASP.NET browser files are not supported in Opera Mobile or Android devices. That means if you request "default.aspx" from Opera mobile browser, it won't redirect to "default_mobile.aspx"

Step 1: Open NuGet Package Manager

Step 2: Install 51Degrees

Step 3: Define 51Degrees Configuration Section

Step 4: Define 51Degrees/wurfl

The above configuration changes automatically update the ASP.NET browser detection capabilities and you can easily detect the modern mobile devices/browsers. If you request "default.aspx" from Opera mobile browser after this configuration changes, it will automatically redirect to "default_mobile.aspx" page as shown below.

Conclusion

I hopes you got some idea about 51Degrees, WURFL and ASP.NET browser detection. Thanks for reading. This is the same as my original post ASP.NET mobile device detection.

Comments and Discussions

I use mobi - and it just works. If you use it in a commercial environment and want to make use of a lot more of the properties detected with constand WURFL updates, it's best to pay the piper.

I use it to initially detect the user's device screen resolution and then display accordingly. For what I was doing, responsive wasn't giving me what I wanted. (using Telerk grids and wanted them to be the way I wanted them to look).

If the user wants to switch views, i let them change it with that ddSlick dropdown at the top right of http://www.renepilon.com/Forum

Microsoft.Web.Infrastructure is needed to start the Http modules when they're not included in the web.config file. NuGet does not allow the web.config to be edited and the modules included automatically. Therefore we need to have Microsoft.Web.Infrastructure. The dependency is now available via NuGet and we've linked to this in the latest version. You should therefore be able to simply take the latest version of 51Degrees.mobi from NuGet to resolve the problem.

You can also take the source code from codeplex at http://51degrees.codeplex.com[^], and/or edit the web.config manually. Full documentation is available at...