Export (0) Print
Expand All
Expand Minimize

HasBackButton Property

.NET Framework 1.1

Returns true if the device or browser has a dedicated back button. The default value is true.

public virtual bool HasBackButton {
   get
}

Example

The following example demonstrates how to use the HasBackButton property to provide a link control when a back button is not available.

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

Dim currentCapabilities As MobileCapabilities = CType(Request.Browser, MobileCapabilities)
If currentCapabilities.HasBackButton Then
   Link1.Visible = False
   lblTemp.Text = "Press Browser's back button to go back"
   lblTemp.Visible = True
Else
   ' Provide a Link control instead.
   Link1.Visible = True
End If

End Sub
[C#]

void Page_Load(Object sender, EventArgs e)
{
   MobileCapabilities currentCapabilities
      = (MobileCapabilities)Request.Browser;
   if (currentCapabilities.HasBackButton)
   {
      Link1.Visible = false;
      lblTemp.Text = "Press Browser's back button to go back";
      lblTemp.Visible = true;
   }
   else
   {
      // Provide a Link control instead.
      Link1.Visible = true;
   }
}

See Also

Applies to: MobileCapabilities Class

Show:
© 2014 Microsoft