PhoneCall Class

Provides control capability to render a command that the user can select to dial the specified phone number.

public class System.Web.UI.MobileControls.PhoneCall : 
   System.Web.UI.MobileControls.TextControl

Remarks

For devices with telephony capability, such as a cell phone, the PhoneCall control renders a command that the user can select to dial the specified phone number.

On devices without telephony capability, the PhoneCall control renders alternate text, possibly including the phone number or a link; it is not treated as a command that has dialing capability.

Example

This example shows how you can set the properties of the PhoneCall object while a page loads. Alternatively, these properties can be set as attributes in the PhoneCall ASP.NET mobile control.

<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage" 
   Language="VB" %>
<%@ Register TagPrefix="mobile"
    Namespace="System.Web.UI.MobileControls"
    Assembly="System.Web.Mobile" %>

<script Language="vb" runat="server">

Public Sub Page_Load(source As Object, e As EventArgs)
   PhoneCall1.AlternateFormat = "{0}"

   ' Alternate URL.
   PhoneCall1.AlternateUrl = "http://www.microsoft.com/"
   PhoneCall1.PhoneNumber = "555-0187"
   PhoneCall1.Text = "My Number"
End Sub

</script>

<Mobile:Form runat="server" id="Form1">
   <mobile:PhoneCall runat="server" id="PhoneCall1" />
</Mobile:Form>
[C#]
<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage" 
   Language="c#" %>
<%@ Register TagPrefix="mobile"
    Namespace="System.Web.UI.MobileControls"
    Assembly="System.Web.Mobile" %>

<script Language="c#" runat="server">

public void Page_Load(Object source, EventArgs e)
{
   PhoneCall1.AlternateFormat = "{0}";

   // Alternate URL.
   PhoneCall1.AlternateUrl = "http://www.microsoft.com/";
   PhoneCall1.PhoneNumber = "555-0187";
   PhoneCall1.Text = "My Number";
}

</script>

<Mobile:Form runat="server" id="Form1">
   <mobile:PhoneCall runat="server" id="PhoneCall1" />
</Mobile:Form>

Requirements

Namespace: System.Web.UI.MobileControls

Assembly: System.Web.Mobile

See Also

PhoneCall Control | PhoneNumber Property | AlternateFormat Property | AlternateUrl Property