• About Us
  • Blog
  • Basket
  • Account
  • Sign In
  •  

Blog

Published on Tuesday, February 28, 2012

Integrating 51D Framework - .Net Mobile Toolkit with existing ASP.Net web application

This blog briefs on the steps involved in configuring the 51D Framework - .Net Mobile Toolkit with an existing ASP.Net application. These steps are common to ASP.Net web applications based on .Net 2.0 and .Net 4.0.

Integrating the 51D Framework with an existing ASP.Net web application involves configuring the licence key, defining required custom configurations and referring to appropriate version of Framework assemblies. Let’s look at each step in brief assuming you have already installed the 51D Framework - .Net Mobile Toolkit.

1. Adding 51d Configuration file to App_Data folder of the Web application.

Add the required 51D custom configuration file to App_Data folder by following the options Project->Add New Item->Mobile->51D Configuration file. The language can either be C# or VB.Net.

This configuration file will have all the required configuration sections related to the 51Degrees.mobi products Framework, Foundation and Device data. The default configuration settings are sufficient to start testing the mobile version of your web application. For more details on each configuration section please refer to the Framework Documentation.

2. Add required HttpHandler(s) and HttpModule(s) to default web.config file.

Following HttpHandler and HttpModule configurations need to be added to the default web.config file related to 51Degrees.mobi Framework. These sections has to be placed under the appropriate root elements like <system.web> or <system.webserver> based on the executing environment.

Configuration Related to Product Remarks
HttpHandler Framework
<system.web>

   <httpHandlers>
	  <add verb="GET" path="I.axd" 
	     type="FiftyOne.Framework.Mobile.Include.IncludesHandler, FiftyOne.Framework" validate="false"/>
	  <add verb="GET" path="P.axd"
	     type="FiftyOne.Framework.Image.ImageHandler, FiftyOne.Framework" validate="false"/>
   </httpHandlers>


</system.web>

<system.webServer>


   <handlers>
	  <add name="Includes" verb="GET" path="I.axd" 
    	  type="FiftyOne.Framework.Mobile.Includes.IncludesHandler, FiftyOne.Framework"/>
	      <add name="Image" verb="GET" path="P.axd" 
	  type="FiftyOne.Framework.Image.ImageHandler, FiftyOne.Framework" />
   </handlers>


</system.webServer>
HttpModule Foundation and Framework
<add name="Detector"
   type="FiftyOne.Foundation.Mobile.Detection.DetectorModule, FiftyOne.Foundation"/>
<system.web>
   <httpModules>
	  <add name="Detector"
	     type="FiftyOne.Foundation.Mobile.Detection.DetectorModule, FiftyOne.Foundation"/>
   </httpModules>
</system.web>

<system.webServer>
   <modules runAllManagedModulesForAllRequests="true">
	  <add name="51degrees.mobi Device Detector"
	     type="FiftyOne.Foundation.Mobile.Detection.DetectorModule, FiftyOne.Foundation"/>
   </modules>
</system.webServer>

From the above table based on the runtime environment the configuration section either from <system.web> or <system.webServer> has to be copied to web.config file. If you are running the web application from IIS 7 then use the configuration section from the later and comment the section from <system.web> or else IIS will throw configuration error during runtime.

3. Add references to the required assemblies.

The Framework needs 3 assemblies to be referenced for all the features to execute correctly. The assemblies are:

Assembly Features
FiftyOne.Foundation.dll Contains device detection and redirection algorithm. Easy to configure and customize.
FiftyOne.Framework.dll Contains mobile version of custom ASP.Net controls and rich set of features to implement light weight version of Mobile pages.
FiftyOne.MaxMind.dll Contains MaxMind implementation required to detect the location of the device based on the IP address. This is part of the Framework’s Location control.

To add reference use Project -> Add Reference -> Browse option and browse the folder the installed folder. The default installation path is C:\Program Files (x86)\51Degrees.mobi\.Net Mobile Framework\References, select all the 3 assemblies listed in the above table. If your web application is based on .Net 4.0 then select the assemblies from the sub folder Ver4.

4. Finally you have to configure your 51Degrees.mobi – Framework license key

You can convert the existing Asp.Net mobile controls design as 51D Mobi Framework controls with simple steps like add the following configuration section to <system.web> of web.config file and replace the prefix </system.web>asp to mob of the control definitions.

Config section to add to web.config,

<pages enableEventValidation="false" viewStateEncryptionMode="Never">
   <controls>
	  <add assembly="FiftyOne.Framework" namespace="FiftyOne.Framework.Mobile.Controls" tagPrefix="mob"/>
   </controls>
</pages>

Further reading:

1. To understand more about the 51Degrees.mobi Framework features or to know how to implement please go through the documentation and tutorials available on http://51Degrees.mobi.

2. To know more about the 51Degress.mobi features like device detection and redirection or to know how to customize using the configurations please refer here.

For understanding the 51Degrees.mobi Device data usage, auto upgrade and licensing please refer here.

Comments (0)

Author: Products Team

Categories: Development

Tags: Mobile , ASP.NET

Murali Setty
>

Products Team

Other posts by Products Team
Contact author

Name:
Email:
Subject:
Message:
x

Tags

.NET 2013 2014 4G 51Degrees 5G A.C.Roma A7 ABI Acer Affiliate Marketing Alcatel Amazon AMP Analysis Analytics Android Android 5.0 Lollipop Android Kitkat Android Lollipop Android Media Stick Apache API Apple Apple TV Archos Asha Asian Market ASP.NET Asus Australia Big Data Black Friday Blackberry Blink Browser C C# Case Study CeBIT CES Chrome Cloud CMS combinations Comparison Competition CoolPad COTW Cron CSS3 Data Data Blog Data File Data Model Daydream Denver Design Desire Eye Desktop Detection Developers Device Device Data Device Detection Device Intelligence Device Popularity Device property Device Types Device Use Display dmexco DoCoMo Doogee DotNetNuke Download Drupal Email EReader E-Reader Ericsson Evaluation Event Examples EXPLAY Rio Facebook feature Firefox Firefox OS Fly Foundation Framework France Galaxy S3 Galaxy S5 Galaxy Tab A Galaxy Tab A 8.0 Galaxy Tab A 9.7 Germany git repositories Global Google Google Daydream GSMA HAProxy Hardware Hisense HTC HTC ONE MAX HTC OS HTML5 HTTP Huawei HUAWEI. UPDATE HUDL Huwaei IBC Icemobile Prime 4.0 IE IFA IIS Image Optimiser Image Optimizer India Infographic Ingeniux Internet usage iOS iOS 7 iOS 8 ipad iPhone iPhone 6 IsEmailBrowser IsWebApp Italy Japan Java Javascript Jolla Kentico Keynote Kindle Kindle Fire Kindle Fire HD Leagoo Lenovo LG Location Log File Analysis LTE Lumia m.dot Map Memory Meta Data Mi 4S Micromax Microsoft Miia Style Mobile Mobile Analysis Mobile Analytics Mobile Devices Mobile Marketing Mixer Module Motorola MVC4 MWC MWC 2017 MWC16 MyPhone Native Native Apps NET New Release News News Letter Nexus Nexus 6 Nexus 9 NFC NGINX Nokia Non-Mobile NVIDIA Omate On7 OnePlus 5 Opera Opera Mini Operating System Optimisation OS OSX 10.10 OTA Panasonic Patent PC Pebble Performance phablet phone PHP Poland Presentation Press Release Price Band PRIV PS4 Python QMobile QR Codes Redirection Research Reseller Responsive Images Responsive web design RESS Review reviews RIM Ringmark RWD Samsung Scala Screen Screen resolution Screen Size SEO Server Server-side optimisation Set Box Set Top Box Sharepoint Shark 1 SHIFT phones Sitecore SLUSH Smart TV Smartphone Smartphones Smartwatches Snapdragon Sony Sony Xperia Spain Swedish Beers Symbian Tablet Tablets Tesco Testing Tips Top 5 TOTW TV UDS UK Umbraco Update updates US User Agent UserAgent User-Agent Vendors Version 3 VoLTE VR Wearable Web Web Apps WebKit WebMatrix White Paper Widgets Widnows WiFi Wiko Wileyfox Windows Windows Phone Xbox XBox One Xiaomi Xperia Xperia z Yosemite Z10 ZenFon 2 ZOPO ZTE