Share via


Choices Property

Retrieves the collection of choices in a <DeviceSpecific> element.

public System.Web.UI.MobileControls.DeviceSpecificChoiceCollection
   Choices {
   get
}

Remarks

At run time, the choices in the collection are evaluated in the order that they are stored. For more information about choice and device-specific concepts, see the <Choice> element.

Example

The following example demonstrates the use of the Choices property to display the number of templates contained in the first filter defined in the ASP.NET mobile Web application.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
   
If Panel1.IsTemplated Then
   Label1.Text = Label1.Text + "Loaded panel has " + Panel1.DeviceSpecific.Choices(0).Templates.Count.ToString() + " Templates for Filter named  " + Panel1.DeviceSpecific.Choices(0).Filter.ToString()
Else
   Label1.Text = "Loaded panel doesn't have Templates"
End If

End Sub

[C#]
public void Page_Load(Object source, EventArgs e)
{
    if (Panell1.IsTemplated)
    {
      lblStatus.Text = lblStatus.Text +  "Loaded panel has " + 
        Panel1.DeviceSpecific.Choices[0].Templates.Count.ToString() +
        " Templates for Filter named  " +
        Panel1.DeviceSpecific.Choices[0].Filter.ToString();
    }
    else
    {
       lblStatus.Text = "Loaded panel doesn't have Templates";         
    }
}  

See Also

Applies to: DeviceSpecific Class