SlideShare a Scribd company logo
Developing Web Applications Using ASP.NET
In this session, you will learn to:
Explain how to detect mobile devices and redirect them to an
appropriate page in a Web application
Describe mobile Web pages, forms, and mobile controls
Explain how to use device-specific features in mobile Web
pages to respond to the different capabilities of mobile devices
Explain how to use device emulators in Microsoft Visual Studio
2005 to test mobile Web pages
Design and implement mobile Web forms
Design device-specific features for mobile Web pages
Objectives
Developing Web Applications Using ASP.NET
Device emulators run on a computer but behave as Pocket
PCs, mobile phones, or other piece of hardware.
Developer can use device emulators to test applications on
a range of different devices without having to obtain, install,
or configure all of them.
Visual Studio integrates the device emulators into the
development environment to help streamline the production
and testing of mobile applications.
Microsoft Device Emulator 1.0 included in Visual Studio
2005 can emulate devices running:
Microsoft Windows CE 5.0
Microsoft Pocket PC 2003
Microsoft Smartphone 2003
Device Emulators for Mobile Web Forms
Developing Web Applications Using ASP.NET
You can start the device emulators using the Device
Emulator Manager.
Device Emulators for Mobile Web Forms (Contd.)
Developing Web Applications Using ASP.NET
You can simulate placing a device in its cradle and
saving the state of the device.
You can simulate a device with a storage card by using a
shared folder on your hard drive, and specifying the
amount of memory available to the device.
Microsoft Device Emulator can browse a Visual Studio
Web project by using:
Physical network card installed on the computer
Microsoft Loopback Adapter
Microsoft ActiveSync 4.1
Device Emulators for Mobile Web Forms (Contd.)
Developing Web Applications Using ASP.NET
Other Device Emulators:
Manufacturers of mobile devices also provide emulators of
their hardware.
An appropriate emulator needs to be installed in case the
application is targeted to a specific device.
Device Emulators for Mobile Web Forms (Contd.)
Developing Web Applications Using ASP.NET
In Visual Studio 2005, you can:
Activate a device emulator by using the Connect To Device
command on the Tools menu.
Control device emulators by using Device Emulator Manager
command on the Tools menu.
Configure device emulators by clicking the Options command
on the Tools menu and then clicking Device Tools.
Device Emulators for Mobile Web Forms (Contd.)
Connect to Device Command
Device Emulator Manager
Options Command
Developing Web Applications Using ASP.NET
Web applications designed to run on mobile devices as well
as desktop computers typically:
Detect the type of device requesting the Web page.
Redirect the request to pages specifically designed for mobile
devices, if necessary.
Mobile Device Detection and Redirection
Developing Web Applications Using ASP.NET
Using the Browser Object to Detect a Mobile Device:
The Request.Browser property returns an
HttpBrowserCapabilities object that contains information
about the browser that initiated the request.
The HttpBrowserCapabilities object includes the
IsMobileDevice property to detect mobile-device requests.
A Web request from a mobile device can be redirected to
another Web page:
protected void Page_Load(object sender, EventArgs e)
{
if(Request.Browser.IsMobileDevice)
Response.Redirect("MobileForms/default.aspx");
}
Mobile Device Detection and Redirection (Contd.)
Developing Web Applications Using ASP.NET
Many mobile devices do not support cookies. Therefore, you
should avoid using cookies in mobile applications.
Some mobile devices do not accept relative URLs.
To handle such devices, an <httpRuntime> tag can be
inserted in the Web.config file:
<system.web>
<httpRuntime useFullyQualifiedRedirectUrl="true" />
</system.web>
Mobile Device Detection and Redirection (Contd.)
Developing Web Applications Using ASP.NET
ASP .NET enables you to create Web pages targeted
specifically to mobile devices. These Web pages are called
mobile Web pages.
Mobile Web pages respond to the constraints of small
screens and adapt to various capabilities easily.
Mobile Web pages are designed by using Mobile server
controls.
ASP.NET Mobile Designer can be used to design and build
mobile Web pages.
ASP.NET Mobile Designer is similar to the Web Designer,
with Design and Source views to create the layout and code
window to write the code.
Mobile controls cannot be resized in the Mobile Designer.
Design view of a mobile page is not a WYSIWYG editor.
Mobile Web Forms
Developing Web Applications Using ASP.NET
Mobile Web pages are instances of the
System.Web.UI.MobileControls.MobilePage class.
A mobile Web page must contain at least one
<mobile:Form> tag.
A single Web form is broken into several forms for a mobile
device.
Switching from one form to another is done
programmatically.
Each form on the page shares the same code-behind file.
Each control is usually placed on a new line. However, by
setting the BreakAfter property, controls can be arranged
in the same line.
Mobile Web Forms (Contd.)
Developing Web Applications Using ASP.NET
Mobile server controls are members of the
System.Web.UI.MobileControls namespace.
Mobile server controls are designed and optimized for use
on mobile device.
Many mobile server controls are directly analogous to
existing Web server controls.
Some controls that are unique to the
System.Web.UI.MobileControls namespace are:
PhoneCall
ControlPager
DeviceSpecific
Mobile Web Forms (Contd.)
Developing Web Applications Using ASP.NET
Mobile server controls are present in the Mobile Web Forms
group in the Toolbox.
Mobile Web Forms (Contd.)
Mobile Server Controls
Developing Web Applications Using ASP.NET
Depending on the capabilities of the viewing device,
different content may need to be rendered on a mobile
page.
You can use the <DeviceSpecfic> tag to enable you to
perform conditional rendering.
The <DeviceSpecific> tag enables you to write markup
that is specific to a device.
Within the <DeviceSpecific> tag, you can add child
<Choice> tags.
Device-Specific Features in Mobile Web Forms
Developing Web Applications Using ASP.NET
The <Choice> tag includes:
A filter attribute to specify the device that the choice applies
to.
One or more property values, which will override the
corresponding tag on the original control if this choice is used.
<mobile:Image runat=server>
<DeviceSpecific>
<Choice Filter=“TestIsColor"
ImageURL="colorTree.gif"/>
<Choice Filter=“TestIsWML11"
ImageURL="tree.wbmp"/>
<Choice ImageURL="monoTree.gif"/>
</DeviceSpecific>
</mobile:Image>
Device-Specific Features in Mobile Web Forms (Contd.)
Developing Web Applications Using ASP.NET
The Filter attribute in each <Choice> tag can have two
types of values:
The name of a method on the page.
The name of a device filter in the Web.config file.
When the name of a method is used as a filter:
The choice is applied on the basis of the Boolean value
returned by the method.
The filter method must conform to the following signature:
public bool methodName(
System.Web.Mobile.MobileCapabilities capabilities,
string optionalArgument);
Device-Specific Features in Mobile Web Forms (Contd.)
Developing Web Applications Using ASP.NET
When a device filter in Web.Config is used as a filter:
The filter can be of two types:
Comparison filter
Evaluator delegate filter
The following code represents the use of the two types of
filters:
<system.web>
<deviceFilters>
<filter name="TestIsColor" compare="IsColor"
argument="true" />
<filter name="TestColorDepth"
type="clsDeviceTests" method="testDepth" />
</deviceFilters>
</system.web>
Device-Specific Features in Mobile Web Forms (Contd.)
Developing Web Applications Using ASP.NET
Problem Statement:
You are a developer in the Adventure Works organization, a
fictitious bicycle manufacturer. You have been asked to assist
in the development of the Business-to-Consumer (B2C) Web
application and a related Business-to-Employee (B2E) extranet
portal.
Decisions on the design of the application have already been
taken. You have been asked to carry out a number of specific
tasks in order to implement various elements of this design.
Demo: Making Web Applications Available to Mobile
Developing Web Applications Using ASP.NET
As part of the first phase of the B2C development, you have
been asked to create a new page, MobileDefault.aspx,
specifically designed for PDAs, mobile phones, and other
mobile devices. Mobile devices will be automatically forwarded
to this page, and the page will respond to the specific
capabilities of the device that makes a request.
Demo: Making Web Applications Available to Mobile (Contd.)
Developing Web Applications Using ASP.NET
Solution:
You need to perform following tasks:
1. Manage Redirection for Mobile Devices
a. Open the Adventure Works Web site for editing in Visual Studio.
b. Detect mobile devices on the Adventure Works home page.
c. Handle devices that cannot use relative URLs.
d. Add a new mobile page to the application.
e. Configure the Pocket PC emulator and browse the Web application.
2. Design and Implement a Mobile Web Form
a. Add controls to the default form of the MobileDefault.aspx page.
b. Add a second form to the MobileDefault.aspx page.
Demo: Making Web Applications Available to Mobile (Contd.)
Developing Web Applications Using ASP.NET
3. Design Device-Specific Features for a Mobile Web Application
a. Add a new method for evaluating the color depth of a browser.
b. Insert device-specific features into MobileDefault.aspx.
c. Check the capabilities of the browser in your code.
4. Browse a Mobile Web Application with Specific Device Emulators
a. Browse the project with the Pocket PC emulator.
b. Browse the project by using the Smartphone emulator.
c. Browse the project by using Internet Explorer.
Demo: Making Web Applications Available to Mobile (Contd.)
Developing Web Applications Using ASP.NET
In this session, you learned that:
Visual Studio 2005 includes the Microsoft Device Emulator 1.0.
which can emulate devices running Microsoft Windows CE 5.0,
Microsoft Pocket PC 2003, and Microsoft Smartphone 2003.
Many manufacturers of mobile devices also provide emulators
of their hardware to assist in developing mobile applications.
Visual Studio provides options in Tools menu to activate,
control, and configure device emulators.
The Request.Browser property returns an
HttpBrowserCapabilities object that contains information
about the browser that initiated the request.
The ASP.NET Mobile Designer is used to design and build
mobile Web pages.
Summary
Developing Web Applications Using ASP.NET
In mobile Web pages, a single Web form is broken up into
several forms to cope with the small screen size of a mobile
device.
Mobile server controls are designed to adapt intelligently to the
capabilities of the requesting browser.
<DeviceSpecfic> tag is used in a mobile page to write
markup that is specific to a device.
Summary (Contd.)

More Related Content

What's hot (20)

Unit2
Unit2Unit2
Unit2
DevaKumari Vijay
 
Android layouts
Android layoutsAndroid layouts
Android layouts
Jeffrey Quevedo
 
Android User Interface
Android User InterfaceAndroid User Interface
Android User Interface
Shakib Hasan Sumon
 
Getting started with ibm worklight tips
Getting started with ibm worklight tipsGetting started with ibm worklight tips
Getting started with ibm worklight tips
bupbechanhgmail
 
Android development session 3 - layout
Android development   session 3 - layoutAndroid development   session 3 - layout
Android development session 3 - layout
Farabi Technology Middle East
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layout
Krazy Koder
 
View groups containers
View groups containersView groups containers
View groups containers
Mani Selvaraj
 
Integrating into Visual Studio settings
Integrating into Visual Studio settingsIntegrating into Visual Studio settings
Integrating into Visual Studio settings
PVS-Studio
 
IBM MobileFirst Platform 7.0 POT InApp Feedback V0.1
IBM MobileFirst Platform 7.0 POT InApp Feedback V0.1IBM MobileFirst Platform 7.0 POT InApp Feedback V0.1
IBM MobileFirst Platform 7.0 POT InApp Feedback V0.1
Banking at Ho Chi Minh city
 
04 user interfaces
04 user interfaces04 user interfaces
04 user interfaces
C.o. Nieto
 
AndroidManifest
AndroidManifestAndroidManifest
AndroidManifest
Ahsanul Karim
 
IBM MobileFirst Platform Pot Sentiment Analysis v3
IBM MobileFirst Platform Pot Sentiment Analysis v3IBM MobileFirst Platform Pot Sentiment Analysis v3
IBM MobileFirst Platform Pot Sentiment Analysis v3
Banking at Ho Chi Minh city
 
Android Widget
Android WidgetAndroid Widget
Android Widget
ELLURU Kalyan
 
Multiple Activity and Navigation Primer
Multiple Activity and Navigation PrimerMultiple Activity and Navigation Primer
Multiple Activity and Navigation Primer
Ahsanul Karim
 
IBM MobileFirst Platform v7.0 POT App Mgmt Lab v1.1
IBM MobileFirst Platform  v7.0 POT App Mgmt Lab v1.1IBM MobileFirst Platform  v7.0 POT App Mgmt Lab v1.1
IBM MobileFirst Platform v7.0 POT App Mgmt Lab v1.1
Banking at Ho Chi Minh city
 
Chapter 10 - Views Part 2
Chapter 10 - Views Part 2Chapter 10 - Views Part 2
Chapter 10 - Views Part 2
Sittiphol Phanvilai
 
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & MenusLearn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Eng Teong Cheah
 
IBM MobileFirst Platform v7.0 POT Offers Lab v1.0
IBM MobileFirst Platform v7.0 POT Offers Lab v1.0IBM MobileFirst Platform v7.0 POT Offers Lab v1.0
IBM MobileFirst Platform v7.0 POT Offers Lab v1.0
Banking at Ho Chi Minh city
 
Rc085 010d-vaadin7
Rc085 010d-vaadin7Rc085 010d-vaadin7
Rc085 010d-vaadin7
Cosmina Ivan
 
Integrate Shindig with Joomla
Integrate Shindig with JoomlaIntegrate Shindig with Joomla
Integrate Shindig with Joomla
Anand Sharma
 
Getting started with ibm worklight tips
Getting started with ibm worklight tipsGetting started with ibm worklight tips
Getting started with ibm worklight tips
bupbechanhgmail
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layout
Krazy Koder
 
View groups containers
View groups containersView groups containers
View groups containers
Mani Selvaraj
 
Integrating into Visual Studio settings
Integrating into Visual Studio settingsIntegrating into Visual Studio settings
Integrating into Visual Studio settings
PVS-Studio
 
IBM MobileFirst Platform 7.0 POT InApp Feedback V0.1
IBM MobileFirst Platform 7.0 POT InApp Feedback V0.1IBM MobileFirst Platform 7.0 POT InApp Feedback V0.1
IBM MobileFirst Platform 7.0 POT InApp Feedback V0.1
Banking at Ho Chi Minh city
 
04 user interfaces
04 user interfaces04 user interfaces
04 user interfaces
C.o. Nieto
 
IBM MobileFirst Platform Pot Sentiment Analysis v3
IBM MobileFirst Platform Pot Sentiment Analysis v3IBM MobileFirst Platform Pot Sentiment Analysis v3
IBM MobileFirst Platform Pot Sentiment Analysis v3
Banking at Ho Chi Minh city
 
Multiple Activity and Navigation Primer
Multiple Activity and Navigation PrimerMultiple Activity and Navigation Primer
Multiple Activity and Navigation Primer
Ahsanul Karim
 
IBM MobileFirst Platform v7.0 POT App Mgmt Lab v1.1
IBM MobileFirst Platform  v7.0 POT App Mgmt Lab v1.1IBM MobileFirst Platform  v7.0 POT App Mgmt Lab v1.1
IBM MobileFirst Platform v7.0 POT App Mgmt Lab v1.1
Banking at Ho Chi Minh city
 
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & MenusLearn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Eng Teong Cheah
 
IBM MobileFirst Platform v7.0 POT Offers Lab v1.0
IBM MobileFirst Platform v7.0 POT Offers Lab v1.0IBM MobileFirst Platform v7.0 POT Offers Lab v1.0
IBM MobileFirst Platform v7.0 POT Offers Lab v1.0
Banking at Ho Chi Minh city
 
Rc085 010d-vaadin7
Rc085 010d-vaadin7Rc085 010d-vaadin7
Rc085 010d-vaadin7
Cosmina Ivan
 
Integrate Shindig with Joomla
Integrate Shindig with JoomlaIntegrate Shindig with Joomla
Integrate Shindig with Joomla
Anand Sharma
 

Similar to 10 asp.net session14 (20)

Programming basics
Programming basicsProgramming basics
Programming basics
Senri DLN
 
12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17
Vivek Singh Chandel
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04
Vivek Singh Chandel
 
unit 4.docx
unit 4.docxunit 4.docx
unit 4.docx
Sadhana Sreekanth
 
02 asp.net session02
02 asp.net session0202 asp.net session02
02 asp.net session02
Vivek Singh Chandel
 
Web tech
Web techWeb tech
Web tech
SangeethaSasi1
 
Web tech
Web techWeb tech
Web tech
SangeethaSasi1
 
Web tech
Web techWeb tech
Web tech
SangeethaSasi1
 
Web techh
Web techhWeb techh
Web techh
SangeethaSasi1
 
android training_material ravy ramio
android training_material ravy ramioandroid training_material ravy ramio
android training_material ravy ramio
slesulvy
 
02 asp.net session02
02 asp.net session0202 asp.net session02
02 asp.net session02
Mani Chaubey
 
ASP.NET Interview Questions PDF By ScholarHat
ASP.NET  Interview Questions PDF By ScholarHatASP.NET  Interview Questions PDF By ScholarHat
ASP.NET Interview Questions PDF By ScholarHat
Scholarhat
 
Chapter 09
Chapter 09Chapter 09
Chapter 09
Terry Yoast
 
Upgrading Mobile Tester's Weapons with Advanced Debugging
Upgrading Mobile Tester's Weapons with Advanced DebuggingUpgrading Mobile Tester's Weapons with Advanced Debugging
Upgrading Mobile Tester's Weapons with Advanced Debugging
Abhijeet Vaikar
 
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debuggingATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
Agile Testing Alliance
 
16 asp.net session23
16 asp.net session2316 asp.net session23
16 asp.net session23
Vivek Singh Chandel
 
Android Tutorial
Android TutorialAndroid Tutorial
Android Tutorial
Fun2Do Labs
 
Android App Development 20150409
Android App Development 20150409Android App Development 20150409
Android App Development 20150409
Hideo Kadowaki
 
Test Bank for Java How to Program Late Objects 10th Edition Deitel 0132575655...
Test Bank for Java How to Program Late Objects 10th Edition Deitel 0132575655...Test Bank for Java How to Program Late Objects 10th Edition Deitel 0132575655...
Test Bank for Java How to Program Late Objects 10th Edition Deitel 0132575655...
giloulaiz
 
Sybase sup hybrid_web_container_article_wp
Sybase sup hybrid_web_container_article_wpSybase sup hybrid_web_container_article_wp
Sybase sup hybrid_web_container_article_wp
Prabhakar Manthena
 
Programming basics
Programming basicsProgramming basics
Programming basics
Senri DLN
 
android training_material ravy ramio
android training_material ravy ramioandroid training_material ravy ramio
android training_material ravy ramio
slesulvy
 
02 asp.net session02
02 asp.net session0202 asp.net session02
02 asp.net session02
Mani Chaubey
 
ASP.NET Interview Questions PDF By ScholarHat
ASP.NET  Interview Questions PDF By ScholarHatASP.NET  Interview Questions PDF By ScholarHat
ASP.NET Interview Questions PDF By ScholarHat
Scholarhat
 
Upgrading Mobile Tester's Weapons with Advanced Debugging
Upgrading Mobile Tester's Weapons with Advanced DebuggingUpgrading Mobile Tester's Weapons with Advanced Debugging
Upgrading Mobile Tester's Weapons with Advanced Debugging
Abhijeet Vaikar
 
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debuggingATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
Agile Testing Alliance
 
Android Tutorial
Android TutorialAndroid Tutorial
Android Tutorial
Fun2Do Labs
 
Android App Development 20150409
Android App Development 20150409Android App Development 20150409
Android App Development 20150409
Hideo Kadowaki
 
Test Bank for Java How to Program Late Objects 10th Edition Deitel 0132575655...
Test Bank for Java How to Program Late Objects 10th Edition Deitel 0132575655...Test Bank for Java How to Program Late Objects 10th Edition Deitel 0132575655...
Test Bank for Java How to Program Late Objects 10th Edition Deitel 0132575655...
giloulaiz
 
Sybase sup hybrid_web_container_article_wp
Sybase sup hybrid_web_container_article_wpSybase sup hybrid_web_container_article_wp
Sybase sup hybrid_web_container_article_wp
Prabhakar Manthena
 

More from Vivek Singh Chandel (20)

Deceptive Marketing.pdf
Deceptive Marketing.pdfDeceptive Marketing.pdf
Deceptive Marketing.pdf
Vivek Singh Chandel
 
brain controled wheel chair.pdf
brain controled wheel chair.pdfbrain controled wheel chair.pdf
brain controled wheel chair.pdf
Vivek Singh Chandel
 
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Vivek Singh Chandel
 
Manav dharma shashtra tatha shashan paddati munshiram jigyasu
Manav dharma shashtra tatha shashan paddati   munshiram jigyasuManav dharma shashtra tatha shashan paddati   munshiram jigyasu
Manav dharma shashtra tatha shashan paddati munshiram jigyasu
Vivek Singh Chandel
 
Self driving and connected cars fooling sensors and tracking drivers
Self driving and connected cars fooling sensors and tracking driversSelf driving and connected cars fooling sensors and tracking drivers
Self driving and connected cars fooling sensors and tracking drivers
Vivek Singh Chandel
 
EEG Acquisition Device to Control Wheelchair Using Thoughts
EEG Acquisition Device to Control Wheelchair Using ThoughtsEEG Acquisition Device to Control Wheelchair Using Thoughts
EEG Acquisition Device to Control Wheelchair Using Thoughts
Vivek Singh Chandel
 
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Vivek Singh Chandel
 
Net framework session01
Net framework session01Net framework session01
Net framework session01
Vivek Singh Chandel
 
Net framework session03
Net framework session03Net framework session03
Net framework session03
Vivek Singh Chandel
 
Net framework session02
Net framework session02Net framework session02
Net framework session02
Vivek Singh Chandel
 
04 intel v_tune_session_05
04 intel v_tune_session_0504 intel v_tune_session_05
04 intel v_tune_session_05
Vivek Singh Chandel
 
03 intel v_tune_session_04
03 intel v_tune_session_0403 intel v_tune_session_04
03 intel v_tune_session_04
Vivek Singh Chandel
 
02 intel v_tune_session_02
02 intel v_tune_session_0202 intel v_tune_session_02
02 intel v_tune_session_02
Vivek Singh Chandel
 
01 intel v_tune_session_01
01 intel v_tune_session_0101 intel v_tune_session_01
01 intel v_tune_session_01
Vivek Singh Chandel
 
09 intel v_tune_session_13
09 intel v_tune_session_1309 intel v_tune_session_13
09 intel v_tune_session_13
Vivek Singh Chandel
 
07 intel v_tune_session_10
07 intel v_tune_session_1007 intel v_tune_session_10
07 intel v_tune_session_10
Vivek Singh Chandel
 
01 asp.net session01
01 asp.net session0101 asp.net session01
01 asp.net session01
Vivek Singh Chandel
 
15 asp.net session22
15 asp.net session2215 asp.net session22
15 asp.net session22
Vivek Singh Chandel
 
14 asp.net session20
14 asp.net session2014 asp.net session20
14 asp.net session20
Vivek Singh Chandel
 
13 asp.net session19
13 asp.net session1913 asp.net session19
13 asp.net session19
Vivek Singh Chandel
 
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Vivek Singh Chandel
 
Manav dharma shashtra tatha shashan paddati munshiram jigyasu
Manav dharma shashtra tatha shashan paddati   munshiram jigyasuManav dharma shashtra tatha shashan paddati   munshiram jigyasu
Manav dharma shashtra tatha shashan paddati munshiram jigyasu
Vivek Singh Chandel
 
Self driving and connected cars fooling sensors and tracking drivers
Self driving and connected cars fooling sensors and tracking driversSelf driving and connected cars fooling sensors and tracking drivers
Self driving and connected cars fooling sensors and tracking drivers
Vivek Singh Chandel
 
EEG Acquisition Device to Control Wheelchair Using Thoughts
EEG Acquisition Device to Control Wheelchair Using ThoughtsEEG Acquisition Device to Control Wheelchair Using Thoughts
EEG Acquisition Device to Control Wheelchair Using Thoughts
Vivek Singh Chandel
 
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Vivek Singh Chandel
 

Recently uploaded (20)

How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 

10 asp.net session14

  • 1. Developing Web Applications Using ASP.NET In this session, you will learn to: Explain how to detect mobile devices and redirect them to an appropriate page in a Web application Describe mobile Web pages, forms, and mobile controls Explain how to use device-specific features in mobile Web pages to respond to the different capabilities of mobile devices Explain how to use device emulators in Microsoft Visual Studio 2005 to test mobile Web pages Design and implement mobile Web forms Design device-specific features for mobile Web pages Objectives
  • 2. Developing Web Applications Using ASP.NET Device emulators run on a computer but behave as Pocket PCs, mobile phones, or other piece of hardware. Developer can use device emulators to test applications on a range of different devices without having to obtain, install, or configure all of them. Visual Studio integrates the device emulators into the development environment to help streamline the production and testing of mobile applications. Microsoft Device Emulator 1.0 included in Visual Studio 2005 can emulate devices running: Microsoft Windows CE 5.0 Microsoft Pocket PC 2003 Microsoft Smartphone 2003 Device Emulators for Mobile Web Forms
  • 3. Developing Web Applications Using ASP.NET You can start the device emulators using the Device Emulator Manager. Device Emulators for Mobile Web Forms (Contd.)
  • 4. Developing Web Applications Using ASP.NET You can simulate placing a device in its cradle and saving the state of the device. You can simulate a device with a storage card by using a shared folder on your hard drive, and specifying the amount of memory available to the device. Microsoft Device Emulator can browse a Visual Studio Web project by using: Physical network card installed on the computer Microsoft Loopback Adapter Microsoft ActiveSync 4.1 Device Emulators for Mobile Web Forms (Contd.)
  • 5. Developing Web Applications Using ASP.NET Other Device Emulators: Manufacturers of mobile devices also provide emulators of their hardware. An appropriate emulator needs to be installed in case the application is targeted to a specific device. Device Emulators for Mobile Web Forms (Contd.)
  • 6. Developing Web Applications Using ASP.NET In Visual Studio 2005, you can: Activate a device emulator by using the Connect To Device command on the Tools menu. Control device emulators by using Device Emulator Manager command on the Tools menu. Configure device emulators by clicking the Options command on the Tools menu and then clicking Device Tools. Device Emulators for Mobile Web Forms (Contd.) Connect to Device Command Device Emulator Manager Options Command
  • 7. Developing Web Applications Using ASP.NET Web applications designed to run on mobile devices as well as desktop computers typically: Detect the type of device requesting the Web page. Redirect the request to pages specifically designed for mobile devices, if necessary. Mobile Device Detection and Redirection
  • 8. Developing Web Applications Using ASP.NET Using the Browser Object to Detect a Mobile Device: The Request.Browser property returns an HttpBrowserCapabilities object that contains information about the browser that initiated the request. The HttpBrowserCapabilities object includes the IsMobileDevice property to detect mobile-device requests. A Web request from a mobile device can be redirected to another Web page: protected void Page_Load(object sender, EventArgs e) { if(Request.Browser.IsMobileDevice) Response.Redirect("MobileForms/default.aspx"); } Mobile Device Detection and Redirection (Contd.)
  • 9. Developing Web Applications Using ASP.NET Many mobile devices do not support cookies. Therefore, you should avoid using cookies in mobile applications. Some mobile devices do not accept relative URLs. To handle such devices, an <httpRuntime> tag can be inserted in the Web.config file: <system.web> <httpRuntime useFullyQualifiedRedirectUrl="true" /> </system.web> Mobile Device Detection and Redirection (Contd.)
  • 10. Developing Web Applications Using ASP.NET ASP .NET enables you to create Web pages targeted specifically to mobile devices. These Web pages are called mobile Web pages. Mobile Web pages respond to the constraints of small screens and adapt to various capabilities easily. Mobile Web pages are designed by using Mobile server controls. ASP.NET Mobile Designer can be used to design and build mobile Web pages. ASP.NET Mobile Designer is similar to the Web Designer, with Design and Source views to create the layout and code window to write the code. Mobile controls cannot be resized in the Mobile Designer. Design view of a mobile page is not a WYSIWYG editor. Mobile Web Forms
  • 11. Developing Web Applications Using ASP.NET Mobile Web pages are instances of the System.Web.UI.MobileControls.MobilePage class. A mobile Web page must contain at least one <mobile:Form> tag. A single Web form is broken into several forms for a mobile device. Switching from one form to another is done programmatically. Each form on the page shares the same code-behind file. Each control is usually placed on a new line. However, by setting the BreakAfter property, controls can be arranged in the same line. Mobile Web Forms (Contd.)
  • 12. Developing Web Applications Using ASP.NET Mobile server controls are members of the System.Web.UI.MobileControls namespace. Mobile server controls are designed and optimized for use on mobile device. Many mobile server controls are directly analogous to existing Web server controls. Some controls that are unique to the System.Web.UI.MobileControls namespace are: PhoneCall ControlPager DeviceSpecific Mobile Web Forms (Contd.)
  • 13. Developing Web Applications Using ASP.NET Mobile server controls are present in the Mobile Web Forms group in the Toolbox. Mobile Web Forms (Contd.) Mobile Server Controls
  • 14. Developing Web Applications Using ASP.NET Depending on the capabilities of the viewing device, different content may need to be rendered on a mobile page. You can use the <DeviceSpecfic> tag to enable you to perform conditional rendering. The <DeviceSpecific> tag enables you to write markup that is specific to a device. Within the <DeviceSpecific> tag, you can add child <Choice> tags. Device-Specific Features in Mobile Web Forms
  • 15. Developing Web Applications Using ASP.NET The <Choice> tag includes: A filter attribute to specify the device that the choice applies to. One or more property values, which will override the corresponding tag on the original control if this choice is used. <mobile:Image runat=server> <DeviceSpecific> <Choice Filter=“TestIsColor" ImageURL="colorTree.gif"/> <Choice Filter=“TestIsWML11" ImageURL="tree.wbmp"/> <Choice ImageURL="monoTree.gif"/> </DeviceSpecific> </mobile:Image> Device-Specific Features in Mobile Web Forms (Contd.)
  • 16. Developing Web Applications Using ASP.NET The Filter attribute in each <Choice> tag can have two types of values: The name of a method on the page. The name of a device filter in the Web.config file. When the name of a method is used as a filter: The choice is applied on the basis of the Boolean value returned by the method. The filter method must conform to the following signature: public bool methodName( System.Web.Mobile.MobileCapabilities capabilities, string optionalArgument); Device-Specific Features in Mobile Web Forms (Contd.)
  • 17. Developing Web Applications Using ASP.NET When a device filter in Web.Config is used as a filter: The filter can be of two types: Comparison filter Evaluator delegate filter The following code represents the use of the two types of filters: <system.web> <deviceFilters> <filter name="TestIsColor" compare="IsColor" argument="true" /> <filter name="TestColorDepth" type="clsDeviceTests" method="testDepth" /> </deviceFilters> </system.web> Device-Specific Features in Mobile Web Forms (Contd.)
  • 18. Developing Web Applications Using ASP.NET Problem Statement: You are a developer in the Adventure Works organization, a fictitious bicycle manufacturer. You have been asked to assist in the development of the Business-to-Consumer (B2C) Web application and a related Business-to-Employee (B2E) extranet portal. Decisions on the design of the application have already been taken. You have been asked to carry out a number of specific tasks in order to implement various elements of this design. Demo: Making Web Applications Available to Mobile
  • 19. Developing Web Applications Using ASP.NET As part of the first phase of the B2C development, you have been asked to create a new page, MobileDefault.aspx, specifically designed for PDAs, mobile phones, and other mobile devices. Mobile devices will be automatically forwarded to this page, and the page will respond to the specific capabilities of the device that makes a request. Demo: Making Web Applications Available to Mobile (Contd.)
  • 20. Developing Web Applications Using ASP.NET Solution: You need to perform following tasks: 1. Manage Redirection for Mobile Devices a. Open the Adventure Works Web site for editing in Visual Studio. b. Detect mobile devices on the Adventure Works home page. c. Handle devices that cannot use relative URLs. d. Add a new mobile page to the application. e. Configure the Pocket PC emulator and browse the Web application. 2. Design and Implement a Mobile Web Form a. Add controls to the default form of the MobileDefault.aspx page. b. Add a second form to the MobileDefault.aspx page. Demo: Making Web Applications Available to Mobile (Contd.)
  • 21. Developing Web Applications Using ASP.NET 3. Design Device-Specific Features for a Mobile Web Application a. Add a new method for evaluating the color depth of a browser. b. Insert device-specific features into MobileDefault.aspx. c. Check the capabilities of the browser in your code. 4. Browse a Mobile Web Application with Specific Device Emulators a. Browse the project with the Pocket PC emulator. b. Browse the project by using the Smartphone emulator. c. Browse the project by using Internet Explorer. Demo: Making Web Applications Available to Mobile (Contd.)
  • 22. Developing Web Applications Using ASP.NET In this session, you learned that: Visual Studio 2005 includes the Microsoft Device Emulator 1.0. which can emulate devices running Microsoft Windows CE 5.0, Microsoft Pocket PC 2003, and Microsoft Smartphone 2003. Many manufacturers of mobile devices also provide emulators of their hardware to assist in developing mobile applications. Visual Studio provides options in Tools menu to activate, control, and configure device emulators. The Request.Browser property returns an HttpBrowserCapabilities object that contains information about the browser that initiated the request. The ASP.NET Mobile Designer is used to design and build mobile Web pages. Summary
  • 23. Developing Web Applications Using ASP.NET In mobile Web pages, a single Web form is broken up into several forms to cope with the small screen size of a mobile device. Mobile server controls are designed to adapt intelligently to the capabilities of the requesting browser. <DeviceSpecfic> tag is used in a mobile page to write markup that is specific to a device. Summary (Contd.)