Upraviť

Zdieľať cez


DeviceSpecific.SelectedChoice Property

Definition

Gets the currently selected choice, or null if none are applicable. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

public:
 property System::Web::UI::MobileControls::DeviceSpecificChoice ^ SelectedChoice { System::Web::UI::MobileControls::DeviceSpecificChoice ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Web.UI.MobileControls.DeviceSpecificChoice SelectedChoice { get; }
[<System.ComponentModel.Browsable(false)>]
member this.SelectedChoice : System.Web.UI.MobileControls.DeviceSpecificChoice
Public ReadOnly Property SelectedChoice As DeviceSpecificChoice

Property Value

The currently selected choice.

Attributes

Examples

The following code example demonstrates how to use the SelectedChoice property to display the filter associated with the current choice. For a more complete code sample, see the example for the DeviceSpecific overview.

public void Page_Load(object source, EventArgs e)
{
    if (!IsPostBack)
    {
        string txt = "Selected Filter is {0}";
        Label1.Text = String.Format(txt, 
            Panel1.DeviceSpecific.SelectedChoice.Filter.ToString());
    }
}
Public Sub Page_Load(ByVal source As Object, ByVal e As EventArgs)
    If Not IsPostBack Then
        Dim txt As String = "Selected Filter is {0}"
        Label1.Text = String.Format(txt, _
            Panel1.DeviceSpecific.SelectedChoice.Filter.ToString())
    End If
End Sub

Remarks

You can use a DeviceSpecific/Choice construct to specify device-specific content, such as property overrides or templates, for a control or style. To select a choice from the choices in a <DeviceSpecific> element, ASP.NET evaluates each choice in sequential order against the capabilities of the target device. The first matching choice is made the selected choice, and is used for device-specific content.

Applies to

See also