The Part5 of the series on Mobile Web Development deals with the text-based, output-only controls like PhoneCall, Link and TextView.
PhoneCall Control
The PhoneCall control is an easy, text-based, output-only control that is used to represent a phone number to call.
Properties
AlternateFormat - Formatting string for the text value of the PhoneNumber property. This is used only for devices that are unable to initiate phone calls from Web content. The default value is {0} {1}, where {0} is the value of the Text property, and {1} is the value of the PhoneNumber property.
AlternateURL - This is used for devices that are unable to initiate phone calls from Web content. The default value is null.
PhoneNumber - Sets or returns a string that represents a phone number (required).
SoftKeylabel - Sets or returns the label used for the command when it is displayed on a soft key. The default value is an empty string.
Text (inherited from TextControl class) Specifies the text for a control to be rendered for devices that can initiate phone calls. The default value is Phone Number. The Text property can be specified through the Text attribute, or as inner text.
The following controls can contain one or more ObjectList controls.
System.Web.UI.MobileControls.Form
System.Web.UI.MobileControls.Panel
Device-Specific Behavior
Devices with telephony capability
On devices that support programmatically placing phone calls, the control's text is displayed as a command. Invoking that command dials the phone number or presents the user with a number of options for dialing the phone number (some cell phones automatically do the latter). If the text field is not defined, the PhoneNumber property is used.
The rendering behavior in this case is identical to that of a Link control for the specified device.
Devices without telephony capability
The AlternateFormat property is treated as a formatting string that generates the text for displaying the phone number based on the value of the AlternateURL property. When the AlternateURL property contains null, the PhoneCall control renders the number in as the Label control for the specified device. When the AlternateURL property contains a value other than null it renders the number in the same way as the Link control for the specified device.
Example7
The following example shows a phonecall control in a mobile form control.
AlternateURL="http://www.xyz.com"
phoneNumber="123-456-7890">XYZ Company
Link Control
It represents a hyperlink to another Form control on a mobile page or an arbitrary URL displaying the value in the Text property.
When the link is clicked, control immediately changes to the page in the specified NavigateURL property. If the Text property is not defined, the default of the link is the AlternateURL property.
Device Specific Behavior - HTML
At run time, the Link control renders a link as a standard HTML tag (anchor)
Device Specific Behavior - WML
A link generates markup similar to the following.
TextProperty
In both the cases, if the value of the link starts with a number symbol (#), it is rendered as a postback event. A
tag (line break) follows the link.
Example8
TextView Control
The TextView control sets and displays arbitrary amounts of text, with optional markup tags. It alos supports internal pagination.
The text is rendered in the same way in both HTML and WML forms.
Example9
My TextView control Text.
Summary
This is the last of the series of articles published on mobile web development. There are plenty of other standard controls which the users have already aware of. Most of them are similar in feature and behavior as the other controls discussed in this article.
Regard
Prateek
The code examples are not displaying properly for any of these pages. Try escaping the < and >
ReplyDeleteGreat Article
ReplyDeleteCASP.NET Online Training | C# Online Training
ASP.NET Training In Chennai | C# Training in Chennai