51Degrees.mobi company is developing a solution for web developers to organize a simplified work with mobile platforms. Using the company's product, you can easily and accurately identify a mobile client that requests a web page and process this request by returning the data as required for the client.
51Degrees.mobi recently
announced support for the Umbraco CMS and the WebMatrix development platform for which automatic installation packages were released. Packages are available at the following addresses:
- for Umbraco CMS ( link );
- NuGet-package for WebMatrix ( link ).
You can easily use the package for working with
Umbraco CMS as it is written in
this article .
Let's see how this works on the example package for WebMatrix.
')
Package installation
Create or open a site in WebMatrix based on the “Start Site” template. In the “Site” section of WebMatrix, you will find the “Administration of ASP.NET Web Pages” item (Figure 1).
Fig. 1. Link to project administration in WebMatrixGo to the administration page using this item. After entering the password and fulfilling the project setting requirements (you must rename the file in the project), you will be taken to the list of NuGet packages (Figure 2).
Fig. 2. List of packages available for installation in the projectThe first package is the 51Degrees.mobi package we need. Over time, it will cease to be the first, but you can always find it through the search.
Click “Install” in front of the package and the package will be installed in your project automatically (Figure 3).
Fig. 3. Confirmation of successful installation of the packageAfter that, you can close the window and return to WebMatrix. Click the “Restart” button to restart your site (Figure 4).
Fig. 4. Restarting the siteAfter that, run the site for execution. You will see the standard view of an ASP.NET web project or your own site (Figure 5).
Fig. 5. Running applicationRequest from mobile client
Now we will try to simulate the access to the page through the mobile client. To do this, we use the rich capabilities of the Internet Explorer browser developer tools. Call the toolbar via the F12 hot key or from the “Developer Tools” menu.
Fig. 6. Internet Explorer Developer ToolsIn the tool window, select “Service”, “Change user agent string”, “Special” and set the following parameters:
Clear name - Windows Phone 7User Agent String - Mozilla / 4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident / 3.1; IEMobile / 7.0)
Fig. 7. Installing a Mobile User Agent in Internet ExplorerClick “Install”. After that, refresh the site page in the browser. Now the web application, which is expanded by the 51Degrees.mobi package, considers that we have logged in from a mobile device and automatically forms the default mobile view page (Figure 8).
Fig. 8. Mobile page generated automatically when requested from a mobile clientConclusion
Thus, our site with the installation of the 51Degrees.mobi package automatically received request processing functionality from mobile clients with full support for customer information. After that, the developer simply add the appropriate processing and, depending on the type of client, return certain pages with different designs.