Export (0) Print
Expand All
Expand Minimize

CanInitiateVoiceCall Property

.NET Framework 1.1

Returns true if the device is capable of initiating a voice call. The default value is false.

public virtual bool CanInitiateVoiceCall {
   get
}

Example

The following example demonstrates how to use the CanInitiateVoiceCall property.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

   PhoneCall1.Text = "Police, Fire, Ambulance"
   PhoneCall1.PhoneNumber = "911"

   Dim currentCapabilities As System.Web.Mobile.MobileCapabilities = CType(Request.Browser, System.Web.Mobile.MobileCapabilities)

If currentCapabilities.CanInitiateVoiceCall Then
   PhoneCall1.AlternateFormat = "Call {0} at {1}"
Else

   PhoneCall1.AlternateFormat = " You can click this link " + "to navigate it's Web Site"
End If

End Sub

[C#]

public void Page_Load(Object sender, EventArgs e)
{
   MobileCapabilities currentCapabilities
      = (MobileCapabilities)Request.Browser;
   if (currentCapabilities.CanInitiateVoiceCall)
   {
     phoneCall1.AlternateFormat = "Call {0} at {1}";
   }
   else
   {
      phoneCall1.AlternateFormat = " You can click this link "
        + "to navigate it's Web Site";
   }
} 

See Also

Applies to: MobileCapabilities Class

Show:
© 2014 Microsoft