Académique Documents
Professionnel Documents
Culture Documents
NET
Objectives
Ver. 1.0
Slide 1 of 30
After deploying a Web application, a System Administrator needs to constantly monitor the application for its proper functioning. By monitoring a Web application, you can detect the problems occurring in the application and troubleshoot them. Monitoring and troubleshooting are required to improve the performance of a Web application. To help you track monitor a Web application, ASP.NET provides you with the following two features:
Health monitoring Performance monitoring
Ver. 1.0
Slide 2 of 30
Ver. 1.0
Slide 3 of 30
You can configure applications to use built-in or customized monitoring providers. To use the health monitoring system you need to:
Configure and enable Web events to monitor. Configure and enable event providers that listen for and process various Web events.
Ver. 1.0
Slide 4 of 30
There are several events that you can trap to monitor the health of a Web application. Some of the important events are:
WebBaseEvent WebBaseErrorEvent WebHeartbeatEvent WebRequestEvent WebErrorEvent WebApplicationLifetimeEvent WebRequestErrorEvent WebAuditEvent WebFailureAuditEvent
Ver. 1.0
Slide 5 of 30
The event providers are used to listen for Web events that are raised by a Web application. Some of the built-in providers are:
EventLogWebEventProvider SqlWebEventProvider SimpleMailWebEventProvider and TemplatedMailWebEventProvider TraceWebEventProvider WmiWebEventProvider
Ver. 1.0
Slide 6 of 30
Performance is an important factor in making a Web application or project successful. You need to monitor a Web application to troubleshoot any performance-related issues. You need to keep a track of such errors to improve the performance of your Web application. ASP.NET provides you with several performance counters, such as Application Restarts, Requests Queued, and Errors Total to help you keep track of the execution of your Web application.
Ver. 1.0
Slide 7 of 30
Ver. 1.0
Slide 8 of 30
Ver. 1.0
Slide 9 of 30
Ver. 1.0
Slide 10 of 30
Mobile devices have many limitations such as small display area and low bandwidth. Due to these limitations, a Web page created for desktop browsers cannot be properly displayed on mobile devices. You need to create specifically designed Web pages for mobile devices. ASP.NET provides you with the System.Web.Mobile namespace that is used specifically for mobile Web development. The System.Web.Mobile namespace contains the core capabilities such as authentication and error handling, required for building ASP.NET mobile Web applications.
Ver. 1.0
Slide 11 of 30
The ASP.NET mobile Web controls are contained in the System.Web.UI.MobileControls namespace that provides the user interface elements for rendering mobile Web applications. Some controls that are specific to the mobile Web pages are:
Form control Command control PhoneCall control List and ObjectList control DeviceSpecific control SelectionList control StyleSheet control TextView control
Ver. 1.0
Slide 12 of 30
Form control:
A Form control is a container control that provides the capability to group controls together. Each Form control can hold a group of logically related controls. The Form controls can be displayed by setting the ActiveForm property of the Web page.
Command control:
A Command control combines the functionality of the normal Button, ImageButton, and LinkButton controls. The Command control has properties similar to that of the Button server control. The Command control can be added to a mobile page by using the <Command> element.
Ver. 1.0
Slide 13 of 30
PhoneCall control:
A PhoneCall control is used to enable applications to initiate telephone calls if the user's mobile device supports the capability of placing phone calls:
If the mobile supports the capability, the phone number specified by using PhoneNumber property of the PhoneCall control is displayed as hyperlink. If the mobile device does not support the capability, the PhoneCall control displays the phone number as text.
The PhoneCall control can be added to a mobile page by using the <PhoneCall> element. To use a PhoneCall control, you need to:
Add the control onto a Form or Panel control or inside a control's template on an ASP.NET mobile Web page. Specify the Text and the PhoneNumber properties.
Ver. 1.0
Slide 14 of 30
Ver. 1.0
Slide 15 of 30
DeviceSpecific control:
The DeviceSpecific control is used to specify a choice among multiple content alternatives. The DeviceSpecific control is used to specify template sets and override properties.
SelectionList control:
The SelectionList control provides different visual representations for a list of selectable items. The SelectionList control combines the functionality of the CheckBox, CheckBoxList, DropDownList, ListBox, RadioButton, and the RadioButton Web server controls. You can use the SelectType property of the SelectionList control to define the type of selection list button to render.
Ver. 1.0
Slide 16 of 30
TextView control:
The TextView control is to display large quantities of text. The TextView control supports device filters for overriding property values. The TextView control can be added to a mobile page by using the <TextView> element.
Ver. 1.0
Slide 17 of 30
Device emulators:
Are software programs that simulate the environment of a cell phone or PDA on the desktop of your PC. Are treated as virtual mobile devices. Are available, for most mobile devices, to simulate the behavior of the hardware and browsers of the mobiles. Allow you to view mobile Web forms as they would appear on the actual mobile devices. Enable you to test your mobile Web applications before deploying.
Ver. 1.0
Slide 18 of 30
There are various mobile devices available in the market that have different capabilities and differ from each other in terms of:
Screen size Color combination Browser type Many other features
Due to these differences, a Web control is rendered differently on different mobile devices. Therefore, if you want to create a Web application that can run on multiple mobile devices, you need to create a separate user interface for each device, which is a tedious and complex task. This task can be simplified by using control adapters and device filters provided by ASP.NET.
Ver. 1.0
Slide 19 of 30
Mobile devices have different screen sizes and capabilities. The controls are rendered on the Web page on the basis of the capabilities of a browser that requested for the page. This type of browser-based rendering of controls is known as adaptive rendering and can be implemented by using control adapters. A control adapter is used for device-specific rendering of mobile Web controls instead of using the control's default rendering logic.
Ver. 1.0
Slide 20 of 30
To customize the behavior of Web controls, you need to specify an object of the ControlAdapter class. The ControlAdapter class:
Is an abstract class that defines the basic functionality for all adapters. Overrides certain methods and events of the Control class to allow browser or markup-specific handling.
Ver. 1.0
Slide 21 of 30
Different mobile devices have different capabilities. Therefore, you should design a Web page that caters to all the possible types of mobile devices. The ability to render a control based on the type of the device is known as device-specific rendering. This requires you to set the properties of the controls based on the capabilities of the mobile devices by using device filters. ASP.NET allows you to specify device filters for each type of device by using the <DeviceSpecific><Choice> tags. You can insert the <DeviceSpecific> tag as a child element of any mobile control on the Web page.
Ver. 1.0
Slide 22 of 30
Ver. 1.0
Slide 23 of 30
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 24 of 30
Ver. 1.0
Slide 25 of 30
Problem Statement:
The management of MusicMania has decided to make its Web application available on mobile devices. In the initial phase, you are only required to create the MobileMusic.aspx page that should be displayed as the home page when a user requests for the MusicMania website. This page should contain two forms, frmHome and frmAlbum. When a mobile device requests for the home page, the frmHome form should be displayed on the MobileMusic page. This form should display the colored logo of the company. There should also be a button, DisplayAlbumDetails, on the frmHome form. When the user clicks this button, the frmAlbum form should be displayed. The frmAlbum form should display the details of the latest album.
Ver. 1.0
Slide 26 of 30
Solution:
To design the MobileMusic page, you need to perform the following tasks:
1. Add a new Web Page. 2. Design the new Web page. 3. Execute the application by using device emulator.
Ver. 1.0
Slide 27 of 30
A Web page created for desktop browsers cannot be properly displayed on mobile devices because mobile devices have small display area and low bandwidth. ASP.NET provides you with the System.Web.Mobile namespace that is used specifically for mobile Web development.
Ver. 1.0
Slide 28 of 30
Device emulators are software programs that simulate the environment of a cell phone or PDA on the desktop of your PC. A control adapter is used for device-specific rendering of mobile Web controls instead of using the control's default rendering logic.
Ver. 1.0
Slide 29 of 30
To customize the behavior of Web controls, you need to specify an object of the ControlAdapter class. The ControlAdapter class is an abstract class that defines the basic functionality for all adapters. The ability to render a control based on the type of the device is known as device-specific rendering.
Ver. 1.0
Slide 30 of 30