SlideShare una empresa de Scribd logo
1 de 23
Developing Web Applications Using ASP.NET
Objectives


                •   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




     Ver. 1.0                                                                  Slide 1 of 23
Developing Web Applications Using ASP.NET
Device Emulators for Mobile Web Forms


                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



     Ver. 1.0                                                           Slide 2 of 23
Developing Web Applications Using ASP.NET
Device Emulators for Mobile Web Forms (Contd.)


                You can start the device emulators using the Device
                Emulator Manager.




     Ver. 1.0                                                         Slide 3 of 23
Developing Web Applications Using ASP.NET
Device Emulators for Mobile Web Forms (Contd.)


                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




     Ver. 1.0                                                        Slide 4 of 23
Developing Web Applications Using ASP.NET
Device Emulators for Mobile Web Forms (Contd.)


                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.




     Ver. 1.0                                                           Slide 5 of 23
Developing Web Applications Using ASP.NET
Device Emulators for Mobile Web Forms (Contd.)


                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.

                                                    Connect to Device Command




                                                    Device Emulator Manager




                                                   Options Command




     Ver. 1.0                                                                   Slide 6 of 23
Developing Web Applications Using ASP.NET
Mobile Device Detection and Redirection


                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.




     Ver. 1.0                                                             Slide 7 of 23
Developing Web Applications Using ASP.NET
Mobile Device Detection and Redirection (Contd.)


                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");
                   }




     Ver. 1.0                                                         Slide 8 of 23
Developing Web Applications Using ASP.NET
Mobile Device Detection and Redirection (Contd.)


                •   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>




     Ver. 1.0                                                         Slide 9 of 23
Developing Web Applications Using ASP.NET
Mobile Web Forms


               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.

    Ver. 1.0                                                      Slide 10 of 23
Developing Web Applications Using ASP.NET
Mobile Web Forms (Contd.)


                •   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.



     Ver. 1.0                                                           Slide 11 of 23
Developing Web Applications Using ASP.NET
Mobile Web Forms (Contd.)


                •   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




     Ver. 1.0                                                          Slide 12 of 23
Developing Web Applications Using ASP.NET
Mobile Web Forms (Contd.)


                  Mobile server controls are present in the Mobile Web Forms
                  group in the Toolbox.




                Mobile Server Controls




     Ver. 1.0                                                        Slide 13 of 23
Developing Web Applications Using ASP.NET
Device-Specific Features in Mobile Web Forms


                •   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.




     Ver. 1.0                                                      Slide 14 of 23
Developing Web Applications Using ASP.NET
Device-Specific Features in Mobile Web Forms (Contd.)


                •   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>




     Ver. 1.0                                                                 Slide 15 of 23
Developing Web Applications Using ASP.NET
Device-Specific Features in Mobile Web Forms (Contd.)


                •   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);




     Ver. 1.0                                                                 Slide 16 of 23
Developing Web Applications Using ASP.NET
Device-Specific Features in Mobile Web Forms (Contd.)


                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>




     Ver. 1.0                                                            Slide 17 of 23
Developing Web Applications Using ASP.NET
Demo: Making Web Applications Available to Mobile


                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.




     Ver. 1.0                                                           Slide 18 of 23
Developing Web Applications Using ASP.NET
Demo: Making Web Applications Available to Mobile (Contd.)


                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.




     Ver. 1.0                                                         Slide 19 of 23
Developing Web Applications Using ASP.NET
Demo: Making Web Applications Available to Mobile (Contd.)


                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.




     Ver. 1.0                                                                          Slide 20 of 23
Developing Web Applications Using ASP.NET
Demo: Making Web Applications Available to Mobile (Contd.)


                1. 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.
                2. 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.




     Ver. 1.0                                                                     Slide 21 of 23
Developing Web Applications Using ASP.NET
Summary


               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.




    Ver. 1.0                                                           Slide 22 of 23
Developing Web Applications Using ASP.NET
Summary (Contd.)


               • 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.




    Ver. 1.0                                                             Slide 23 of 23

Más contenido relacionado

La actualidad más candente

12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17Niit Care
 
How to pick the right development model for your mobile project?
How to pick the right development model for your mobile project?How to pick the right development model for your mobile project?
How to pick the right development model for your mobile project?Conny Svensson
 
Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App DevelopmentChris Morrell
 
An end-to-end experience of Windows Phone 7 development (Part 1)
An end-to-end experience of Windows Phone 7 development (Part 1)An end-to-end experience of Windows Phone 7 development (Part 1)
An end-to-end experience of Windows Phone 7 development (Part 1)rudigrobler
 
Flash Builder and Flex Future - Multiscreen Development
Flash Builder and Flex Future - Multiscreen DevelopmentFlash Builder and Flex Future - Multiscreen Development
Flash Builder and Flex Future - Multiscreen DevelopmentRyan Stewart
 
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]Sittiphol Phanvilai
 
Architecture app
Architecture appArchitecture app
Architecture appYnon Perek
 
Cross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual StudioCross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual StudioMizanur Sarker
 
Xamarin COE by Mukteswar Patnaik
Xamarin COE by Mukteswar PatnaikXamarin COE by Mukteswar Patnaik
Xamarin COE by Mukteswar PatnaikMukteswar Patnaik
 
Smartface ile Crossplatform Uygulama Geliştirme
Smartface ile Crossplatform Uygulama GeliştirmeSmartface ile Crossplatform Uygulama Geliştirme
Smartface ile Crossplatform Uygulama GeliştirmeMobile İstanbul
 
IBM Worklight for Digital Agencies
IBM Worklight for Digital AgenciesIBM Worklight for Digital Agencies
IBM Worklight for Digital AgenciesGraham Churchill
 
Hybrid Mobile Application Framework
Hybrid Mobile Application FrameworkHybrid Mobile Application Framework
Hybrid Mobile Application Framework동수 장
 
Mobile architecture options
Mobile architecture optionsMobile architecture options
Mobile architecture optionsjohnsprunger
 
Android Development with Flash Platform
Android Development with Flash PlatformAndroid Development with Flash Platform
Android Development with Flash PlatformMihai Corlan
 
Overview on Mobile Cross Platform Development
Overview on Mobile Cross Platform Development Overview on Mobile Cross Platform Development
Overview on Mobile Cross Platform Development Shahar Zrihen
 
The Forgotten Customer (Socrates 2011)
The Forgotten Customer (Socrates 2011)The Forgotten Customer (Socrates 2011)
The Forgotten Customer (Socrates 2011)Thomas Krause
 
Cross Platform Mobile Development with Xamarin
Cross Platform Mobile Development with XamarinCross Platform Mobile Development with Xamarin
Cross Platform Mobile Development with XamarinPuja Pramudya
 

La actualidad más candente (20)

12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17
 
How to pick the right development model for your mobile project?
How to pick the right development model for your mobile project?How to pick the right development model for your mobile project?
How to pick the right development model for your mobile project?
 
Portlet factory 101
Portlet factory 101Portlet factory 101
Portlet factory 101
 
Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App Development
 
An end-to-end experience of Windows Phone 7 development (Part 1)
An end-to-end experience of Windows Phone 7 development (Part 1)An end-to-end experience of Windows Phone 7 development (Part 1)
An end-to-end experience of Windows Phone 7 development (Part 1)
 
Flash Builder and Flex Future - Multiscreen Development
Flash Builder and Flex Future - Multiscreen DevelopmentFlash Builder and Flex Future - Multiscreen Development
Flash Builder and Flex Future - Multiscreen Development
 
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
 
Architecture app
Architecture appArchitecture app
Architecture app
 
Cross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual StudioCross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual Studio
 
Xamarin COE by Mukteswar Patnaik
Xamarin COE by Mukteswar PatnaikXamarin COE by Mukteswar Patnaik
Xamarin COE by Mukteswar Patnaik
 
Smartface ile Crossplatform Uygulama Geliştirme
Smartface ile Crossplatform Uygulama GeliştirmeSmartface ile Crossplatform Uygulama Geliştirme
Smartface ile Crossplatform Uygulama Geliştirme
 
IBM Worklight for Digital Agencies
IBM Worklight for Digital AgenciesIBM Worklight for Digital Agencies
IBM Worklight for Digital Agencies
 
Jquery mobile
Jquery mobileJquery mobile
Jquery mobile
 
Hybrid Mobile Application Framework
Hybrid Mobile Application FrameworkHybrid Mobile Application Framework
Hybrid Mobile Application Framework
 
Mobile architecture options
Mobile architecture optionsMobile architecture options
Mobile architecture options
 
JavaME UI - JMDF 2007
JavaME UI - JMDF 2007JavaME UI - JMDF 2007
JavaME UI - JMDF 2007
 
Android Development with Flash Platform
Android Development with Flash PlatformAndroid Development with Flash Platform
Android Development with Flash Platform
 
Overview on Mobile Cross Platform Development
Overview on Mobile Cross Platform Development Overview on Mobile Cross Platform Development
Overview on Mobile Cross Platform Development
 
The Forgotten Customer (Socrates 2011)
The Forgotten Customer (Socrates 2011)The Forgotten Customer (Socrates 2011)
The Forgotten Customer (Socrates 2011)
 
Cross Platform Mobile Development with Xamarin
Cross Platform Mobile Development with XamarinCross Platform Mobile Development with Xamarin
Cross Platform Mobile Development with Xamarin
 

Similar a 10 asp.net session14

Mobile application
Mobile applicationMobile application
Mobile applicationaspnet123
 
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_wpPrabhakar Manthena
 
02 asp.net session02
02 asp.net session0202 asp.net session02
02 asp.net session02Niit Care
 
01 asp.net session01
01 asp.net session0101 asp.net session01
01 asp.net session01Niit Care
 
IBM Worklight
IBM WorklightIBM Worklight
IBM WorklightNir Elbaz
 
15 asp.net session22
15 asp.net session2215 asp.net session22
15 asp.net session22Niit Care
 
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 DebuggingAbhijeet 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 debuggingAgile Testing Alliance
 
Mobile web application production for business
Mobile web application production for businessMobile web application production for business
Mobile web application production for businessHani Gamal
 
MyMobileWeb Certification Part I
MyMobileWeb Certification Part IMyMobileWeb Certification Part I
MyMobileWeb Certification Part Icrdlc
 
2011 08-24 mobile web app
2011 08-24  mobile web app2011 08-24  mobile web app
2011 08-24 mobile web appSholto Maud
 
Asp interview Question and Answer
Asp interview Question and Answer Asp interview Question and Answer
Asp interview Question and Answer home
 
Virtualization: Force driving cloud computing
Virtualization: Force driving cloud computingVirtualization: Force driving cloud computing
Virtualization: Force driving cloud computingMayank Aggarwal
 

Similar a 10 asp.net session14 (20)

Mobile application
Mobile applicationMobile application
Mobile application
 
Mobile DevTest Dictionary
Mobile DevTest DictionaryMobile DevTest Dictionary
Mobile DevTest Dictionary
 
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
 
Web tech
Web techWeb tech
Web tech
 
Web tech
Web techWeb tech
Web tech
 
Web tech
Web techWeb tech
Web tech
 
Web techh
Web techhWeb techh
Web techh
 
02 asp.net session02
02 asp.net session0202 asp.net session02
02 asp.net session02
 
01 asp.net session01
01 asp.net session0101 asp.net session01
01 asp.net session01
 
IBM Worklight
IBM WorklightIBM Worklight
IBM Worklight
 
15 asp.net session22
15 asp.net session2215 asp.net session22
15 asp.net session22
 
Codegen2021 blazor mobile
Codegen2021 blazor mobileCodegen2021 blazor mobile
Codegen2021 blazor mobile
 
IBM Worklight Whitepaper
IBM Worklight WhitepaperIBM Worklight Whitepaper
IBM Worklight Whitepaper
 
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
 
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
 
Mobile web application production for business
Mobile web application production for businessMobile web application production for business
Mobile web application production for business
 
MyMobileWeb Certification Part I
MyMobileWeb Certification Part IMyMobileWeb Certification Part I
MyMobileWeb Certification Part I
 
2011 08-24 mobile web app
2011 08-24  mobile web app2011 08-24  mobile web app
2011 08-24 mobile web app
 
Asp interview Question and Answer
Asp interview Question and Answer Asp interview Question and Answer
Asp interview Question and Answer
 
Virtualization: Force driving cloud computing
Virtualization: Force driving cloud computingVirtualization: Force driving cloud computing
Virtualization: Force driving cloud computing
 

Más de Niit Care (20)

Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
 
Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
 
Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
 
Ajs 2 a
Ajs 2 aAjs 2 a
Ajs 2 a
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 

Último

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 

Último (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 

10 asp.net session14

  • 1. Developing Web Applications Using ASP.NET Objectives • 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 Ver. 1.0 Slide 1 of 23
  • 2. Developing Web Applications Using ASP.NET Device Emulators for Mobile Web Forms 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 Ver. 1.0 Slide 2 of 23
  • 3. Developing Web Applications Using ASP.NET Device Emulators for Mobile Web Forms (Contd.) You can start the device emulators using the Device Emulator Manager. Ver. 1.0 Slide 3 of 23
  • 4. Developing Web Applications Using ASP.NET Device Emulators for Mobile Web Forms (Contd.) 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 Ver. 1.0 Slide 4 of 23
  • 5. Developing Web Applications Using ASP.NET Device Emulators for Mobile Web Forms (Contd.) 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. Ver. 1.0 Slide 5 of 23
  • 6. Developing Web Applications Using ASP.NET Device Emulators for Mobile Web Forms (Contd.) 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. Connect to Device Command Device Emulator Manager Options Command Ver. 1.0 Slide 6 of 23
  • 7. Developing Web Applications Using ASP.NET Mobile Device Detection and Redirection 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. Ver. 1.0 Slide 7 of 23
  • 8. Developing Web Applications Using ASP.NET Mobile Device Detection and Redirection (Contd.) 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"); } Ver. 1.0 Slide 8 of 23
  • 9. Developing Web Applications Using ASP.NET Mobile Device Detection and Redirection (Contd.) • 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> Ver. 1.0 Slide 9 of 23
  • 10. Developing Web Applications Using ASP.NET Mobile Web Forms 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. Ver. 1.0 Slide 10 of 23
  • 11. Developing Web Applications Using ASP.NET Mobile Web Forms (Contd.) • 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. Ver. 1.0 Slide 11 of 23
  • 12. Developing Web Applications Using ASP.NET Mobile Web Forms (Contd.) • 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 Ver. 1.0 Slide 12 of 23
  • 13. Developing Web Applications Using ASP.NET Mobile Web Forms (Contd.) Mobile server controls are present in the Mobile Web Forms group in the Toolbox. Mobile Server Controls Ver. 1.0 Slide 13 of 23
  • 14. Developing Web Applications Using ASP.NET Device-Specific Features in Mobile Web Forms • 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. Ver. 1.0 Slide 14 of 23
  • 15. Developing Web Applications Using ASP.NET Device-Specific Features in Mobile Web Forms (Contd.) • 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> Ver. 1.0 Slide 15 of 23
  • 16. Developing Web Applications Using ASP.NET Device-Specific Features in Mobile Web Forms (Contd.) • 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); Ver. 1.0 Slide 16 of 23
  • 17. Developing Web Applications Using ASP.NET Device-Specific Features in Mobile Web Forms (Contd.) 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> Ver. 1.0 Slide 17 of 23
  • 18. Developing Web Applications Using ASP.NET Demo: Making Web Applications Available to Mobile 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. Ver. 1.0 Slide 18 of 23
  • 19. Developing Web Applications Using ASP.NET Demo: Making Web Applications Available to Mobile (Contd.) 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. Ver. 1.0 Slide 19 of 23
  • 20. Developing Web Applications Using ASP.NET Demo: Making Web Applications Available to Mobile (Contd.) 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. Ver. 1.0 Slide 20 of 23
  • 21. Developing Web Applications Using ASP.NET Demo: Making Web Applications Available to Mobile (Contd.) 1. 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. 2. 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. Ver. 1.0 Slide 21 of 23
  • 22. Developing Web Applications Using ASP.NET Summary 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. Ver. 1.0 Slide 22 of 23
  • 23. Developing Web Applications Using ASP.NET Summary (Contd.) • 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. Ver. 1.0 Slide 23 of 23

Notas del editor

  1. Device can be emulated from Device Emulator Manager
  2. Device can be emulated from Device Emulator Manager
  3. Device can be emulated from Device Emulator Manager
  4. Explain when o use above techniques
  5. Use Image grab of above options.
  6. Image grab can be included.
  7. Explain the code
  8. Explain the code.
  9. Explain the code.
  10. Explain the code.
  11. Explain the code.
  12. Explain the code.
  13. Explain with example given in SG
  14. Explain with example given in SG
  15. Explain with example given in SG
  16. Explain with example given in SG