PhoneNumber Property

Sets or returns a string that represents a phone number.

public string PhoneNumber {
   get,
   set
}

Remarks

The PhoneNumber property is mandatory on PhoneCall controls.

The PhoneNumber property of the PhoneCall control accepts strings in a variety of formats. The format for the following types of numbers is described by using the Backus-Naur Format (BNF syntax is a way to describe the syntax of file formats):

phone_number         ::= international_number | national_number | 
                         short_number
international_number ::= "+" country_code national_number
short_number         ::= "#" national_number
country_code         ::= (decoration_character | digit)* digit 
                         (decoration_character | digit)*
national_number      ::= (decoration_character | digit)+ 
digit                ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
decoration_character ::= "(" | ")" | "." | "-" | {space}

A phone number can consist of an optional country/region code, prefixed with a + sign, followed by any sequence of numbers that makes up the phone number. The characters marked as decoration_character can appear anywhere in the phone number, and are ignored.

For i-Mode phones, the following rules currently apply when specifying a phone number:

  1. The string must begin with "0" or "#".
  2. If the string begins with "0", the numbers are more than nine digits.
  3. If the string begins with "#", the numbers are more than three digits.
  4. The numbers can contain "(", ")" and "-" in the string.
  5. The string must be fewer than 24 characters.

The following list shows some examples of valid phone numbers:

800.522.2920

+1 (425) 885-8080

+91335303197

Example

The following example demonstrates how to use the PhoneNumber property to set the phone number to "555-0123".

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
     
      PhoneCall1.Text="Humongous Insurance"    
      'Telephony-supported devices will call the following number.
      PhoneCall1.PhoneNumber="555-0123"
      'Browsers that do not have calling capability will navigate to 
      'the URL specified in as an alternate URL.
      PhoneCall1.AlternateUrl="http://www.humongousinsurance.com"

End Sub

[C#]

public void Page_Load()
{
   call1.Text="Humongous Insurance";
   // Telephony-supported devices will call the following number.
   call1.PhoneNumber="555-0123";
   // Browsers that do not have calling capability will navigate to 
   // the URL specified in as an alternate URL.
   call1.AlternateUrl="http://www.humongousinsurance.com" ;
}
<Mobile:Form runat=server id=frmChoice >
   <mobile:PhoneCall runat="server" ID ="call1" />
</Mobile:Form>

See Also

PhoneCall Control

Applies to: PhoneCall Class